Hi, i am trying to populate a drop down menu with data from a mysql table. I have a table called 'country' which contains a list of countries. I want a script that will select these countries from the mysql tale, and popluate them into a drop down menu. I have tried the following but it doesnt seem to work? Can anyone see whats wrong? Or has anyone have any better ways of doing such a thing?
Many thanks
Jonathan
=======
<SELECT NAME='country'>");
$result = mysql_query("SELECT * FROM country",$cn);
while (list($id, $country) = mysql_fetch_row($result)){
echo "<option value=$id>$country</option>";
}
mysql_free_result($result);
print("</select>");