Hello -
I have a table that has various world cities (field city_name) - every city also has a country field (country)which might contain duplicate entries
I currently have a drop down list that displays ALL of the cities - what I want is for them to be broken down by country, with the relevant cities listed under every country.
What I have is:
$result = mysql_query("SELECT * FROM cities ORDER BY city_name",$db);
$myrow = mysql_fetch_array($result);
<select name="selected_city" >
<option selected></option>
<?php do { ?>
<option value="<?php echo $myrow["city_name"];?>">
<? echo $myrow["city_name"];?>
<? } while($myrow = mysql_fetch_array($result)); ?>
</option>
</select>
which works fine, but give me:
Berlin
Bordeaux
Hamburg
London
Manchester
Paris
I'm assuming I would have to create a loop within a loop do to what I want, though, which is:
France
Bordeaux
Paris
Germany
Berlin
Hamburg
England
London
Manchester
Any ideas?
Gordon