How do I populate a select (drop list) on a form using data from a single column from a mysql table, so that each row in the column becomes an option in the select (drop list).
Any assistance will be greatly appreciated
Populating a select form input tag with mysql data
Moderator: General Moderators
Code: Select all
<select name = "select">
<?
$sql = mysql_query("SELECT * FROM table");
while($result = mysql_fetch_array($sql)):
$info = $resultї"info"];
echo"<option value = "$info">$info</option>";
endwhile;
?>
</select>