Hi - I would like to use the same date that I retrieved use a mysql_query two times to populate two pop-up select boxes. I think my problem is I don't understand arrays well enough. Here is the code I'm trying to fix:
<tr>
<td width="50%"><font size="2">Date preference:</font> <b><select name="date_pref1" size="1">
<?
$sql="select distinct section_date from bo_section";
$result=mysql_query($sql, $sql_link);
while ($row=mysql_fetch_array($result)) {
print ("<option value=\"".$row['section date']);
print ("\">".$row['section_date']."</option>\n");
}
print ("
</select></b></td>
<td><font size=2>Date preference:</font> <b><select name=date_pref2 size=1>
");
reset($row);
while ($row) {
print ("<option value=\"".$row['section date']);
print ("\">".$row['section_date']."</option>\n");
}
?>
</select></b></td>
</tr>
the first pop-up box works great. The second doesn't. I don't want to requery the DB for the same info twice. I'm obviously missing somethign obvious here!
the problem is in the area of reset($row); while ($row)
I know that's wrong, I have tried about 47 ways and nothing is seeming to work.
HELP! thanks