bazconnolly
asked on
populate 2nd drop down based on 1st drop down
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
<?php
$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)
please help
thanks
barry
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
<?php
$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)
please help
thanks
barry
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
excllent service thankyou
Open in new window