Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Need help

  • This topic is empty.
Viewing 15 posts - 1 through 15 (of 20 total)
  • Author
    Posts
  • #153204
    eugenef
    Participant

    I am newbee and watching your tut is awesome.I really need some serious help as my ass is on stake.I need to finish up a project a accounting model which is screwing me up.Looking for mentor with whom i can really associate.Your help would be of grate gratitude and image saving for me which i will never forget.Need help on following topics-
    1-Fetch data from mysql between dates stored in varchar form.
    2-session variables
    3-problem in login with drop down.
    4-Little bit of ajax

    I know you must be busy person but
    “A friend in need is a friend indeed”

    Thanks and waiting for your reply
    With Best Wishes;

    #153205
    __
    Participant

    1-Fetch data from mysql between dates stored in varchar form.

    dates should be stored in mysql as DATETIME, not VARCHAR.

    2-session variables

    What about them?

    3-problem in login with drop down.

    What kind of problem?

    4-Little bit of ajax

    What about it?

    ,- – – – — – – – — – – – — – – – –

    if you really are looking for a “mentor,” why don’t you post an actual question? Describe, in specific terms:

    … what you want to accomplish;

    … what you have tried already (show us your code!);

    … what happened (vs. what you expected to happen).

    ,- – – – — – – – — – – – — – – – –

    if, on the other hand, you’re only looking for someone to do work for you, say so and then you can discuss your job with any interested persons.

    #153206
    eugenef
    Participant

    Using tigra calender as date picker which fills database table with VARCHAR dates and not date format.If i use dates it records 0000-00-00.So,of-course its recommended to use date in date form but i have to do in that.I tried this ////////date_format(’10-02-2013′,’%m/%d/%Y’)///////SELECT STR_TO_DATE(YourDateColumn,’%d/%m/%Y’)////////SELECT *////////FROM CashbookWHERE STR_TO_DATE(date,’%Y-%m-%d2′) BETWEEN ‘2013-10-13’ AND ‘2013-10-14’

    cash.php
    `cash.php

    <?php

    include_once('db.php');
    $res = mysql_query('SELECT * FROM CashbookMaster ');

    echo "

    Sno
    HeadName
    Date
    Amount
    BillNo
    BillDate
    PaymentMode
    BankName
    ChequeNo
    Remarks
    Center
    “;
    while( $row = mysql_fetch_array($res) )
    {
    echo “”;
    echo “” . $row[‘Sno’] . “”;
    echo “” . $row[‘HeadName’] . “”;
    echo “” . $row[‘Date’] . “”;
    echo “” . $row[‘Amount’] . “”;
    echo “” . $row[‘BillNo’] . “”;
    echo “” . $row[‘BillDate’] . “”;
    echo “” . $row[‘PaymentMode’] . “”;
    echo “” . $row[‘BankName’] . “”;
    echo “” . $row[‘ChequeNo’] . “”;
    echo “” . $row[‘Remarks’] . “”;
    echo “” . $row[‘Center’] . “”;
    }
    echo “”;
    ?> `
    other 3 issues also i will disscuss.pl

    #153210
    eugenef
    Participant

    yes mentor with whom i can discuss share projects and a cup of coffee for a long term benefit

    #153217
    __
    Participant

    If i use dates it records 0000-00-00.

    That means that whatever format you are proving the dates in is not valid. MySQL uses the format

    YYYY-MM-DD HH:MM:SS

    or, in date() format, like so:

    $mysql_date = date( 'Y-m-d H:i:s' );
    

    Second, the mysql_* functions are deprecated and should not be used in new projects. I would suggest looking into mysqli or PDO instead.

    As for your query, this looks like a typo:

    WHERE STR_TO_DATE(date,’%Y-%m-%d2′) 
    

    Also, please describe what your results are (vs. what you expected).

    When sharing code, it’s a good idea to use Markdown to format it as code. Highlight all your code and click on the [Block Code] button above the comment textbox.

    For larger amounts of code, it is better to use an external service (pastebin, or make a gist on github, for example).

    #153246
    eugenef
    Participant

    @traq forum not right 4 me

    #153247
    eugenef
    Participant

    thanks traq for your suggestions

    my code gives all results with present code where should i change

    $res = mysql_query('SELECT * FROM CashbookMaster' );
    
    #153248
    eugenef
    Participant

    pl check as i cannot make changes to project online.getting screwed up by this from last 2 days

    #153249
    eugenef
    Participant
    #153254
    eugenef
    Participant

    no solu

    #153256
    eugenef
    Participant

    forum not right 4 me

    #153266
    __
    Participant

    I’ve been trying to reply to this, but something’s not working right…

    pl check as i cannot make changes to project online.getting screwed up by this from last 2 days

    Never do you work on a “live” site. Set up a copy (on another domain, or on your local computer) and experiment there. Only push tested, working code to your live site. Version control (e.g., git) is great also.

    my code gives all results with present code where should i change

    $res = mysql_query('SELECT * FROM CashbookMaster' );

    Is this existing code (the SQL part)? Or something new that you’re writing now? If it’s new, I strongly suggest that you change it to use mysqli or PDO, and not the deprecated mysql_* functions.

    As for your query:

    SELECT `cols`,`you`,`want` 
        FROM `Cashbook`
        WHERE `your_date_col` 
            BETWEEN ’2013-10-13′ AND ’2013-10-14′;
    

    Have a look.

    Note that, because you’re using a VARCHAR field, this query will (incorrectly) return only rows from October 13 (whereas a DATETIME column will correctly return rows from the 14th also).

    #153293
    eugenef
    Participant

    i am using wamp server if you want i can show my codes to u on teamveiwer

    #153294
    eugenef
    Participant

    alternately as i am using tigra calender which fills date in m/d/y format and values shows 00/00/0000 if i choose date type,with varchar goes good.Can you suggest me time and calender code which fills up populates itself the moment a form is opened.
    I would be grateful if you check my codes online on wamp thru teamveiwer or any other u have

    #153318
    __
    Participant

    Can you suggest me time and calender code which fills up populates itself the moment a form is opened.

    Do you only want the current date? Or is this something that you want the user to be able to edit?

    For the latter case, you can use php’s date function:

    $rightnow = date( 'Y-m-d H:i:s' );
    

    For the former, you can simply let MySQL take care of it:

    INSERT INTO `your_table`( `datetime_column` ) VALUES( NOW() );
    

    i can show my codes to u on teamveiwer

    I don’t use teamviewer (never heard of it before, in fact).

    I would be grateful if you check my codes online

    I’d be happy to continue to help out with specific problems, but if you’re asking for a full code review, that’s a little much for a forum discussion.

    I do offer consulting services; please contact me if you are interested and we can discuss pricing.

Viewing 15 posts - 1 through 15 (of 20 total)
  • The forum ‘Back End’ is closed to new topics and replies.