Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: time redundancy check
02-19-2006, 06:47 AM #1
- Join Date
- Feb 2006
- Thanked 0 Times in 0 Posts
time redundancy check
i have a problem with time redundancy check.
my system checks whether the date,venue,time start and time end redundant with the records in the database
the codes are :
SELECT * FROM booking WHERE Date = '$Date' AND Venue = '$Venue' AND ((Time_start >= '$TimeStart' AND Time_end < '$TimeEnd') OR (Time_end > '$TimeStart' AND Time_end <= '$TimeEnd'))
data in DB:
let say if the user input:
u can see the user input is redundant to the current data in database but the query returns 0 row.i'm so right now.please someone help me
02-19-2006, 02:02 PM #2
Its probably because of how your times are formatted.
If they were stored in the database as unix time stamps and the times entered by the user were converted to unix time stamps then PHP would be able to compare them.
Although everything i just writ might be wrong...
EDIT: adding to that i found another function that would be more useful.. strtotime
10:00:00 -> unix time stamp
$unixtime = strtotime("10:00:00");
Then you would use the date function in your comparingCode:1140343200
Last edited by goughy000; 02-19-2006 at 02:17 PM.