populate 2nd drop down based on 1st drop down
Posted on 2009-03-31
Hi Thankyou both for your prompt response
I appoligise I should of explained there is only one mysql table called 'Resale' I cant change this and use a separate country table.
Here are the fields in the table I need to use:
Country , City
So I need to select the Country drop down which then populates the second city drop down automatically.
heres what I have got so far
$conn stuff here
$query = "SELECT DISTINCT Country FROM Resale ";
$result = mysql_query($query) or die ( ' error in query ' );
then populate the 1st drop down box
then need to refresh the page to populate the second city drop own box
$query = "SELECT DISTINCT City FROM Resale WHERE Country = (Country from 1st drop down)