SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    Kitty Lizard reptilianfeline's Avatar
    Join Date
    Aug 2002
    Location
    Somewhere in Cyberspace
    Posts
    385
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Select the date and display only one date per day

    I'm trying to put together a shopping cart. As an extra feature I want to be able tu pull up all the orders for a certain date. To make it even better, I want to create a dropdown-list with the dates available in the DB. The problem is... there are several orders placed on each day, and I don't need all those dates.

    I have this query: "SELECT date FROM orders"

    That gives me a list that looks something like this:
    2003-05-13
    2003-05-13
    2003-05-14
    2003-05-14
    etc...

    How do I select only one date per day so the list might look like this instead?
    2003-05-13
    2003-05-14
    etc...

    I never know how many orders will be placed in one day.

    Maybe this can be solved with PHP but I don't know how, so I'm trying mysql first.
    Reptilian Feline
    | www.reptilian-feline.net | Art | Tutorials | Pets | Music |
    Webdesign the hard way...

  2. #2
    Kitty Lizard reptilianfeline's Avatar
    Join Date
    Aug 2002
    Location
    Somewhere in Cyberspace
    Posts
    385
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry... should have read more.
    SELECT DISTINCT date FROM orders
    Reptilian Feline
    | www.reptilian-feline.net | Art | Tutorials | Pets | Music |
    Webdesign the hard way...


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
  •