02/11/2000
Hi,, can someone help with how to populate a select box with data from mysql.
I have the following code so far, but nothing gets displayed on the page.
<form><select name="Category">
<?php // with a while loop
// this loop will iterate as many times as there are records
while($myrow = mysql_fetch_array($result))
{
$topic = $myrow["topicid"];
$topic1 = $myrow["topicname"];
echo "<option value=$topic>$topic1</option>\n";
//echo "$topic";
}
// memory flush
mysql_free_result($result);
?>
</select> </form>