Me too, I think you need to create an array of all the fields. I used this code to create a dropdownlist for days of the week. I'm sure it could be adapted to retrieve table data.
+--- PHP to create list ----+
$days_list = "";
// list options 1 to total amount of days that current month
for ($i = 1; $i < 32; $i++)
{
$print_selected = "";
if ($i==$day) {$print_selected = " SELECTED";}
$days_list .= sprintf('<OPTION VALUE="%d" %s>%02d</OPTION>',$i, $print_selected, $i)."\n";
}
+------ HTML to call list -------+
<select name="day" class="textbox">
<option value="0" selected>
<?php echo $notselected_day?>
</option>