The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

I've tried joining all 3 into 1 query but just get a huge list of the same record.

i don't understand what you are trying to do. are you trying to get one huge query that will give you enough information to fill in all of the drop-down boxes? that's not a good idea. you should instead be writing one query for each drop-down box.

i don't understand what you are trying to do. are you trying to get one huge query that will give you enough information to fill in all of the drop-down boxes? that's not a good idea. you should instead be writing one query for each drop-down box.

Thanks for your reply.

I'm displaying a list of tour dates for each band in the db. When entering a new tour date into the tour_dates table, you select the artist, state and country from db generated pulldown menus. The common value between tables is the artist_id, state_id and country_id.

I'm trying to join all together so that when displaying the tour_date in a web page it doesn't display the id number for each, but the "label" instead.

So, if state_id = 1 and state_name = Alabama, I want 'Alabama' to be displayed instead of '1'.

SELECT tour_dates.state_id,state_name,show_date,venue,city,zip,website,add_bands,notes, tour_dates.country_id,country_name,tour_dates.artist_id,artist_name FROM tour_dates LEFT JOIN menu_states ON tour_dates.state_id=menu_states.state_id LEFT JOIN menu_countries ON tour_dates.country_id=menu_countries.country_id LEFT JOIN artists ON tour_dates.artist_id=artists.artist_id ORDER BY artist_name