Hi all,
Why does the second while loop below not use the value from the query in the select menu? All elements have correct db values.
// perform query
$query = "SELECT class_date, time_start, time_end ".
"FROM class ".
"WHERE course_ID = '$course' ".
"AND location_ID = '$location'";
$result = mysql_query($query) or die(mysql_error());
echo $query;
?>
<form action="course3.php" name="frm_reg" method="post">
<!-- date -->
<select name="class_date">
<?php
while($row = mysql_fetch_array($result))
{
echo '<option value="'.$row['class_date'].'">'.$row['class_date'].'</option>';
}
?>
</select>
<!-- times -->
<select name="time_start">
<option value="0">Select Time</option>
<?php
while($row = mysql_fetch_array($result))
{
echo '<option value="'.$row['time_start'].'">'.$row['time_start'].'</option>';
}
?>
</select>