this is a script i use to selfpopulate a select/listbox, however i use postgresql. ibelieve if you make a couple of minor changes this will work just fine though, i am new to all this as well, so this is the best i can help.
<?php
$table="scholarship"; // name of the table
$limit="20"; // limit # of records in select box
$orderBy="level"; // Usually a column name
$conn = pg_connect("","","","","funds");
if
(!$conn)
{echo "Could not make a connection";exit;}
$sql = "SELECT DISTINCT level FROM $table order by $orderBy;";
$select_box = pg_Exec($conn, $sql);
$numrecords = pg_NumRows($select_box);
echo "<select name=select>";
//pre selected option
echo"<option value=none>select type</option>";
//loop through database to populate select box
for ($j=0; $j < $numrecords; $j++) {
$value = pg_result($select_box, $j, "level"); //column name for the value of the checkbox
$option = pg_result($select_box, $j, "level"); // select option column name
echo"<option value=$value>$option</option>";
}
echo"</select>";
?>