Dynamic Dependent Dropdown from MySQL

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
dr00bie
Forum Newbie
Posts: 1
Joined: Fri Mar 03, 2006 12:18 pm

Dynamic Dependent Dropdown from MySQL

Post by dr00bie »

I need to develop a dynamic dependent dropdown on my site. I have a MySQL database with 2 tables, State and County. The State table only has 1 column, State and the County table has 2 columns, State and County.

I would like to allow users to select a State and have the County dropdown only show the Counties in the State selected. Can anyone help me figure this out?

Thanks,
Drew
nincha
Forum Contributor
Posts: 191
Joined: Fri Mar 28, 2003 12:30 pm
Location: CA, USA

Post by nincha »

once the user selects the state, use javascript to submit the information automatically. Now you have a variable to work with to dynamically change your html.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

might want to look for CoderGoblin's tutorial on this server.
Post Reply