You need to have a submit button for the form...
PHP Code:
<form action="admin_menu.php" method="post">
<select name = School>
<?php
$count = 0;
while ($row = mysql_fetch_array($result)){
echo "<option value='$count'>".$row['School_Name']."</option>";
$count++;
}
?>
</select>
<input type=submit>
</form>
OR, you need to submit the form using JS and onchange for that element.
But, use a straight submit button for now.
Also, check your table Schools - is there no other unique identifier which you can use to identify the School apart from the name?
Otherwise you are going to have fun trying to fetch School number 12 when your backend does not know what 12 applies to:
Most ppl start off with a table like this:
Code:
Schools
======
id | int - autoincrement
School_Name | varchar()
eg
Code:
id | School_Name
==============
12 | Big School
ie
PHP Code:
<?php
$SQL = "SELECT id, School_Name FROM Schools";
$result = mysql_query($SQL, $db_handle) or die(mysql_error());
?>
<form action="admin_menu.php" method="post">
<select name = School>
<?php
while ($row = mysql_fetch_array($result)){
echo "<option value='". $row['id'] ."'>". $row['School_Name'] ."</option>";
}
?>
</select>
<input type=submit>
</form>
You do not have to have a numerical id in your table, its just that they generally do -- if you don't have one, and you cannot/do not want to change the table we can show you a way of selecting by School_Name but it will involve a bit more work.
HTH
Bookmarks