I'm trying to add a drop down menu populated from mysql database. Here is my code:
$sql= "SELECT id, course_period_id from schedule WHERE STUDENT_ID='$_SESSION[student_id]'";
$result=mysql_query($sql);
$options="";
while ($row=mysql_fetch_array($result)) {
$id=$row["id"];
$course_period_id=$row["course_period_id"];
$options.="<OPTION VALUE=\"$course_period_id\">".$course_period_id.'</option>';
}
echo '</TD></TR></TABLE>';
echo '<SELECT>
<OPTION VALUE=0>Choose
<?=$options?>
</SELECT> ';
The problem is that it gives me a drop down menu with zero options. So what should I change in my code?
Thanks