The problem is that when I select the date and time for the backup, the file handler does not perform its function when finding similar dates
<?php if(isset($_POST['submit'])) { $user_id = $_POST["user_id"]; $name = $_POST["name"]; $time = (int) $_POST["time"]; $date = mysql_real_escape_string($_POST['datepicker']); $newdate = strtotime($date); $newNdate = date('Ym-d', $newdate); $room = $_POST["room"]; $currentTime = (int)date('H'); $CheckQuery = "SELECT * FROM room_reserv WHERE room=1 "; $CheckQueryResult = mysqli_query($connection, $CheckQuery); while($CheckQueryRow = mysqli_fetch_assoc($CheckQueryResult) ){ if($CheckQueryRow['rdate'] == $newNdate){ if($time == $CheckQueryRow['rtime']) { $_SESSION["message"] = "This date has been reserved already!"; }else{ $query = "INSERT INTO room_reserv (user_id , name , rtime , rdate, room) VALUES ('{$user_id}' , '{$name}' ,'{$time}' , '{$newNdate}', '{$room}') "; $result = mysqli_query($connection, $query) or die(mysqli_error($connection)); redirect_to("discussion.php"); } }else{ $query = "INSERT INTO room_reserv (user_id , name , rtime , rdate, room) VALUES ('{$user_id}' , '{$name}' ,'{$time}' , '{$newNdate}', '{$room}') "; $result = mysqli_query($connection, $query) or die(mysqli_error($connection)); redirect_to("discussion.php"); } } } ?>
Please help me understand what the error
echo $CheckQueryRow['rdate'] . ' ' . $newNdate;
echo $CheckQueryRow['rdate'] . ' ' . $newNdate;
and show the result - Blacknife