Hi
I created a drop down list box but it cannot show the result. Here is my code:
<form>
<?php
$query4 = "select sname from student";
$result4 = mysql_query($query4) or die('Error : ' . mysql_error());
echo '<select name="student" onchange="this.form.submit()">';
while($row=mysql_fetch_array($result4)){
echo '<option value="' . $row['sname'] . '">' . $row['sname'] . '</option>';
}
echo '</select>';
?>
</form>
After that, I want to select the student name and show his score by the follow SQL:
Select score from student where sname = '$sname'; //here is the problem!!
There is no id primary key for that table, only has 2 columns: sname and score.
Thanks for help