Hi.
In my MySQL database, there is a table, where I store daily recurring events.
I store the time of the event in the field time
, that has the 'TIME' type. How do I select all events within the next hour?
Hi.
In my MySQL database, there is a table, where I store daily recurring events.
I store the time of the event in the field time
, that has the 'TIME' type. How do I select all events within the next hour?
Something like this:
TIMEDIFF(event.time, TIME(NOW())) < TIME('01:00:00')
Try this:
SELECT *
FROM your_table
WHERE TIMEDIFF(`time`,TIME(NOW())) < TIME('01:00:00');