In my code below I have 2 drop down menus. One is a \"Course\" drop down menu and the other is a \"Modules\" drop down menu:
Below is the code:
Change your form tag
to
It's a good idea to validate on serverside too, just add a little code in your existing PHP if you want to check values on serverside:
prepare($sessionquery);
// You only need to call bind_param once
$sessionqrystmt->bind_param("si",$moduleId,$userid);
// get result and assign variables (prefix with db)
$sessionqrystmt->execute();
$sessionqrystmt->bind_result($dbSessionId,$dbSessionDate,$dbSessionTime, $dbModuleId, $dbTeacherId);
$sessionqrystmt->store_result();
$sessionnum = $sessionqrystmt->num_rows();
if($sessionnum ==0){
echo "Sorry, You have No Sessions under this Module
";
}