Reputation: 11
I am trying to set time limit in reservation system. Such that Users must have the ability to remove their bookings, but not before the lapse of 1 minute away from the time when the booking has been entered
<?php
require_once 'connection.php';
if(isset($_SESSION['book'])){
if (isset($_SESSION['book_time'])){
if (time()-$_SESSION['book_time']>= 60){
if (isset($_POST['delete'])){
$machineID = $_POST['machine_id'];
$starttime = $_POST['start_time'];
$qry = "DELETE FROM bookings where machine_id = '$machineID' AND start_time = '$starttime'";
$result = mysql_query($qry,$conn);
if ($result){
if(mysql_affected_rows()>0){
$message[] = 'Booking Deleted form DB';
}
}
}
}
}
}
?>
but it couldn't remove even after 1 min with this script....what could be possible problem
Upvotes: 0
Views: 358
Reputation: 561
Possible problems:
Try to dump this variables. If they are ok try to run query manualy.
Upvotes: 1