The drop down menu below displays options where the value of each option is the StudentId from th database:
<select name="student" id="studentsDrop">
<?php
while ( $currentstudentstmt->fetch() ) {
$stu = $dbStudentId;
if(isset($_POST["student"]) && $stu == $_POST["student"])
echo "<option selected='selected' value='$stu'>" . $dbStudentAlias . " - " . $dbStudentForename . " " . $dbStudentSurname . "</option>" . PHP_EOL;
else
echo "<option value='$stu'>" . $dbStudentAlias . " - " . $dbStudentForename . " " . $dbStudentSurname . "</option>" . PHP_EOL;
}
?>
</select>
But what my question is how do I display an All option where if the user selects this, then the value for this option will be for all student ids.
The code which generates the students values are here:
Just put it there yourself:
You can do the same
_POST['student']check to see ifAllis selected as well.