<h5>Student-sem</h5>
<p>
<select required>";
<option value="">Please select</option>
<?php
$query = "SELECT distinct `sem_no` FROM `course`,`student_info` WHERE course.c_id=student_info.c_id and `s_id` = '$s_id' ORDER BY `sem_no`";
if($query_run = mysql_query($query)) {
while ($arow = mysql_fetch_array($query_run)){
$asem = $arow['sem_no'];
echo "<option >" .$asem. "</option>" ;
}
}
else{
echo mysql_error();
}
?>
</select>
</p>
查询在phpmyadmin bt中返回8个值,只有第一个值显示为此代码