pec_id_original = $int_pec_id and epr_id = $int_epr_id"; //var_dump($_GET); // check registration status $query = "select is_cancelled from resultats_epreuves_commandees where pec_id_original = ". intval($int_pec_id) ." and epr_id = " . intval($int_epr_id); $recStatus = mysqli_query($objDatabase->con, $query); $resStatus = mysqli_fetch_row($recStatus); if($resStatus[0] == '0' || $resStatus[0] == '') $sql = "update resultats_epreuves_commandees set is_cancelled = 1 where pec_id_original = '" . intval($int_pec_id) . "' and epr_id =" . intval($int_epr_id); else $sql = "update resultats_epreuves_commandees set is_cancelled = 0 where pec_id_original = '" . intval($int_pec_id) . "' and epr_id =" . intval($int_epr_id); if(!mysqli_query($objDatabase->con, $sql)) die('Could not delete data: ' . mysqli_connect_error()); header("Location: ../compte");