Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    May 2006
    Posts
    37
    Thanks
    0
    Thanked 0 Times in 0 Posts

    GROUP BY Query Help

    Hi,

    I have two tables:
    - cars
    - manufacturers

    Each with many, many records. I want to display them in a drop-down menu like this:

    manufacturer1
    - car1
    - car2
    - car3
    ..so on
    manufacturer2
    - car1
    - car2
    - car3
    ..so on
    and so on

    I've gotten as far as:

    SELECT id, name, manufacturer FROM cars GROUP BY manufacturer, name;

    But I have no idea what to do next. Can anyone help me?

  • #2
    Super Moderator guelphdad's Avatar
    Join Date
    Mar 2006
    Location
    St. Catharines, Ontario Canada
    Posts
    2,634
    Thanks
    4
    Thanked 148 Times in 139 Posts
    read the albums/artists item in my signature. the php part of the article will do what you are looking for.


  •  

    Posting Permissions

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