Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
340CTResit/cron-session-delete.php
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
40 lines (25 sloc)
828 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
session_start(); | |
include('db/db.php'); | |
//Database connection selection | |
$db=new db(); | |
$db->db_connect(); | |
$db->db_select(); | |
$datetime=date('Y-m-d H:i:s'); | |
$query=mysql_query("select cd.cust_id,cb.booking_dt from customer_details cd left join customer_booking cb on cb.fk_cust_id=cd.cust_id WHERE payment_status='N'"); | |
if(mysql_num_rows($query)) | |
{ | |
while($row=mysql_fetch_array($query)) | |
{ | |
$id=$row['cust_id']; | |
$time=$row['booking_dt']; | |
$time1=strtotime($datetime); | |
$time2=strtotime($time); | |
$diff=round(abs($time1 - $time2) / 60,2); | |
if($diff>10) | |
{ | |
mysql_query("DELETE customer_details,customer_booking FROM customer_details LEFT JOIN customer_booking on customer_details.cust_id=customer_booking.fk_cust_id WHERE customer_details.cust_id=$id "); | |
} | |
} | |
} | |
?> |