drop box

A

Anonymous

Guest
How would i populate a drop box with the content of a mysql databse ?
 
Code:
<?php
$query = 'select id,content from table';
$request = mysql_query($query);
echo '<select name="form_select">';
while($row = mysql_fetch_array($result))
{
echo '<option value="'.$row['id'].'">'.$row['content'].'</option>';
}
echo '</select>';
?>
 
Back
Top