fooley
08-15-2008, 05:33 AM
Hi everybody ,
I have 2 Dropdown :
-1 for Country and 1 for City
Table(ID,Country,City)
for the First Country i load it like this
<select name="Country">
<?php
$result = mysql_query("select distinct(Country) from pas");
while($row = mysql_fetch_row($result)){
?>
<option><?php echo $row[0]; ?></option>
<?php
}
?>
</select>
so the second dropdown will be filled by the city associeted with the country choosen in the first dropdown
<?php
if(isset($_POST['Country'])){
$result = mysql_query("select City from pas where Country='".$_POST['Country']."' ");
while($row = mysql_fetch_row($result)){
?>
<option><?php echo $row[0]; ?></option>
<?php
}
}
i try it this but not working
Thanks
I have 2 Dropdown :
-1 for Country and 1 for City
Table(ID,Country,City)
for the First Country i load it like this
<select name="Country">
<?php
$result = mysql_query("select distinct(Country) from pas");
while($row = mysql_fetch_row($result)){
?>
<option><?php echo $row[0]; ?></option>
<?php
}
?>
</select>
so the second dropdown will be filled by the city associeted with the country choosen in the first dropdown
<?php
if(isset($_POST['Country'])){
$result = mysql_query("select City from pas where Country='".$_POST['Country']."' ");
while($row = mysql_fetch_row($result)){
?>
<option><?php echo $row[0]; ?></option>
<?php
}
}
i try it this but not working
Thanks