autocommit( false ) ; try { $health_reason = ( $health_reason != '' ? $health_reason : '' ) ; // insert into health $mysqli->query("INSERT INTO staff_health ( staff_id, temperature, health_reason ) VALUES ( '".$staff_info['staff_id']."', '".$temperature."', '".$health_reason."' )" ) ; $staff_health_id = $mysqli->insert_id ; pushToUserCron( 'staff_health', $staff_health_id, $staff_info['staff_id'], 'Apply Health', 'Health has been created.' ) ; }catch( Exception $e ){ $error++; } if( $error == 0 ) { $status = '200' ; // commit query $mysqli->commit() ; }else{ $mysqli->rollback() ; } } } require( $require_sub.'footer.php' ) ; ?>