query("UPDATE user_account SET active = '$status' WHERE user_id = '$sid'"); $conn->close(); } function updateStudentClass($sid,$classid){ //In this case we will get the class of the student //But also we update the school id of the user_account include($_SERVER['DOCUMENT_ROOT'] ."/_ps2020/config/connect.php"); $schoolID = 0; $result = $conn->query("SELECT * FROM school_class WHERE class_id = '$classid'"); if($result){ while($row = $result->fetch_assoc()){ $schoolID = $row['school_id']; } } //Now that we have got the school_id for that class $result = $conn->query("UPDATE user_account SET school_id = '$schoolID', class_id = '$classid' WHERE user_id = '$sid'"); $conn->close(); } function updateStudentSchool($sid,$schoolid){ include($_SERVER['DOCUMENT_ROOT'] ."/_ps2020/config/connect.php"); $result = $conn->query("UPDATE user_account SET school_id = '$schoolid', class_id = '0' WHERE user_id = '$sid'"); $conn->close(); } ?>