static function removeInstructor() { $id = $_POST['id']; $cursor = Dispatcher::$mysqli->query("select * from instructor where status='default'"); $row = $cursor->fetch_assoc(); $defaultInstructorID = $row['Person_id']; $default_calendar_id = $row['calendar_id']; Dispatcher::$mysqli->query("update custom_intsructor set instructor_id={$defaultInstructorID} where instructor_id={$id}"); Dispatcher::$mysqli->query("update instructor_has_hours set instructor_id={$defaultInstructorID} where instructor_id={$id}"); $cursor = Dispatcher::$mysqli->query("select * from instructor where `Person_id`={$id}"); $row = $cursor->fetch_assoc(); $prev_calendar_id = $row['calendar_id']; $cursor = Dispatcher::$mysqli->query("select * from event where `instructor_Person_id`={$id}"); $instructorCalendarEvents = new InstructorCalendarEvents(); while ($row = $cursor->fetch_assoc()) { $instructorCalendarEvents->setDefaultInstructor($prev_calendar_id, $row['clndr_event_id'], $default_calendar_id); } Dispatcher::$mysqli->query("delete from instructor where `Person_id`='{$id}'"); Dispatcher::$mysqli->query("delete from person where id='{$id}'"); print_r(Dispatcher::$mysqli->error); $instructors_array = self::getInstructors(); get_instructors_view($instructors_array); }