Hi everyone,
I've tried various solutions with no avail.
Does anyone know a good resource for finding information on how to code a drop-down box (populated with MySQL data) and take the user's input (selection change) in order to populate another MySQL-data driven Drop-Down box?
If the page has to reload, no biggie. But, I'd prefer that it not.
Any ideas?
Help - PHP/MySQL - Populate Drop-Down based on Dynamic Drop-down
Started by ProServ, Feb 10 2008 02:11 PM
3 replies to this topic
#1
Posted 10 February 2008 - 02:11 PM
|
|
|
#2
Guest_Jaan_*
Posted 10 February 2008 - 03:21 PM
Guest_Jaan_*
in that case.. i think you should use ajax (if you don't want page loading) and btw you have pretty nice site ;)
#3
Guest_Jordan_*
Posted 11 February 2008 - 05:27 AM
Guest_Jordan_*
1) You will need to use PHP to connect to MySQL - http://forum.codecal...-php-mysql.html
2) Set your SQL and retrieve your list, populate the values into drop down:
3) To have the page not reload you will need to use JavaScript and PHP (AJAX). Set an onClick or onChange event for the select above. When that events fires call another PHP application that retrieves and returns the second lists values.
2) Set your SQL and retrieve your list, populate the values into drop down:
<select name="name">
<option value="<?php echo $result1; ?>"><?php echo $result1; ?></option>
</select>
3) To have the page not reload you will need to use JavaScript and PHP (AJAX). Set an onClick or onChange event for the select above. When that events fires call another PHP application that retrieves and returns the second lists values.
#4
Guest_Jaan_*
Posted 11 February 2008 - 05:51 AM
Guest_Jaan_*
PHP dynamic population of drop down list based on selection of one list
here's something for you i guess.. i think it helps
here's something for you i guess.. i think it helps


Sign In
Create Account


Back to top









