I'm creating a booking calendar and am having issues making the timeslots that have been booked unavailable. I have populated them separately unfortunately, so the date and timeslot have no connection.
How do I check if both the timeslot and date (in the same ID) have been booked?
$name = $_POST['name'];
$email = $_POST['email'];
$timeslot = $_POST['timeslot'];
$date = $_POST['date'];
$conn = new mysqli("localhost","root","root","bookingCalendar");
if($conn->connect_error){
die("Failed to connect : ".$conn->connect_error);
} else {
$stmt = $conn->prepare("insert into bookings(name, email, timeslot, date) values(?, ?, ?, ?)");
$stmt->bind_param("ssss", $name, $email, $timeslot, $date); //Saves values as strings, thus further functions can't be created
$stmt->execute();
echo '<script>alert("Booking successful!")</script>';
echo "<script> location.href='bookCal.php'; </script>";
$stmt->close();
$conn->close();
}