I am trying to implement a php/mysql statement which only allows users to delete a record at a certain date/time. Users can currently delete a record at anytime. However as it is a booking system, there should be 2 days notice whenever user wants to cancel a booking. Therefore i would like to know how to make a function which prevents users from cancelling a booking that is less than 2 days from the booking date/time.
My table currently has the following fields which are BookingDate and Timeslot.
Here is a snippet of code which currently does the mysql delete function.
$id = $_GET['id'];
$query1="DELETE from bookings1 where booking_id='$id'";
$results = $mysqli->query($query1);
What I would like to do is to validate this delete function to prevent users from deleting records that is less than 48 hours of the booking date ?