Results 1 to 3 of 3

Thread: mySql query?

  1. #1
    Join Date
    Jan 2008
    Posts
    2

    Default mySql query?

    I have a table in which date and events are stored. Each date may have more than one event. How to list it date wise?

    Example:
    2007/12/6 - event1
    2007/12/6 - event2
    2007/12/6 - event3
    2007/12/7 - event4
    2007/12/7 - event5
    2007/12/8 - event6

    I want the result as:
    2007/12/6
    event1
    event2
    event3
    2007/12/7
    event4
    event5
    I am using php, mysql
    Powered by Yahoo!

  2. #2
    Join Date
    Jan 2008
    Posts
    1

    Default

    there is not a single command in sql that is used to disp the data in the way what you wnat.
    ans of your que can be achieved through the use of order by or sort command
    Powered by Yahoo!

  3. #3
    Join Date
    Jan 2008
    Posts
    1

    Default

    You can use an ORDER BY date to sort the events by date. Iterate through the dataset returned and when you hit a new date, output the date. Something like that should work.
    Powered by Yahoo!

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •