PHP data into chained selects.

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
compphenom
Forum Newbie
Posts: 1
Joined: Mon Sep 17, 2007 11:07 am

PHP data into chained selects.

Post by compphenom »

I have a methodology question of what the proper way to do this online. I am coding a website in PHP. I plan to have a chained select to function similar to the one here: http://www.dynamicdrive.com/dynamicinde ... /index.htm

I would narrow down from State -> City -> Local Politician. Needless to say this will be a huge database with 10's of thousands of records eventually so there are performance issues to thing about. How should I go about doing this?

Here are a couple of thoughts I had:

1. Pull down "SELECT * from DBname" into the page (would this be a huge performance hit?), build out the selects and use javascript and/or CSS to enable/disable the selects and populate them with the correct data (like in the dynamic drive example above).

2. Pull Down "SELECT STATE from DBname", then (not exactly sure how to do this) refresh the page pulling down "SELECT CITY from DB" finally refresh the page again using "SELECT PoliticianName"


Thanks for anyone's thoughts. If you could point me in the right direction of an article, tutorial, code samples, ideas, etc about this topic please let me know!

- Kevin
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

Here is a recent post that may have some information of interest:

viewtopic.php?t=60287
(#10850)
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post by Kieran Huggins »

Sounds like a job for AJAX if ever I've heard one...
Post Reply