Need help date based mysql sorting

Discussion in 'PHP' started by Sebastin, May 10, 2008.

  1. #1
    Hello there,

    I have a table with yyyy-mm-dd date field and i want to sort it to the currnt date to the future.

    How to use the select command?

    Please help
     
    Sebastin, May 10, 2008 IP
  2. TeraTask

    TeraTask Peon

    Messages:
    37
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    sort it ascending by the field name. That is the advantage of year, month, then day -- sorting works when treated as a date or a string.
     
    TeraTask, May 10, 2008 IP
  3. Sebastin

    Sebastin Peon

    Messages:
    1,087
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I wasnt to be able to show only the current and future entries not the old ones how will I be able to do that?
     
    Sebastin, May 10, 2008 IP
  4. TeraTask

    TeraTask Peon

    Messages:
    37
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Oh, something like "WHERE my_date_fields_name > NOW() ORDER BY my_date_fields_name ASC"
     
    TeraTask, May 10, 2008 IP
    Sebastin likes this.
  5. Sebastin

    Sebastin Peon

    Messages:
    1,087
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Hey thanks a lot buddy it worked, you are a god to me now, thanks a lot.
     
    Sebastin, May 10, 2008 IP