I am from Indonesia.. I have a table in database which it’s name tb_schedule that contains 3 fields: id_schedule, time_start(time), time_finish(time).
Ex: 10, 08:00:00, 09:45:00 ..etc
In my php, i have time variable that taken from pc’s time.
Ex: $timeNow=’08:10:00′; My problem is I can’t find a right query that take all records that contains time_start<=time_pc<=time_finish. Ex: 08:00:00<=$timeNow<=09:45:00
Please help me..
Thank you before..
Try this:
Where
'08:10:00'is the value of your$timeNowvariable.Here’s an SQL Fiddle so that you can play with the queries: http://sqlfiddle.com/#!2/187a0/1