Hello all,
I have a table which one of it's fields is a timestamp.
I want to select from this table only the records from the last 15 minutes.
I.E. get the system time and compare it to the time stamp in the specific field. if the differnce is less than 15 mins (or any other anount of minutes that i will set up) select the row.
I'm sure it's possible to do in a query and I don't have to get all rows and check in a php script, but I don't now quite how to achive that.
Any ideas?
dates diff in mysql query
Moderator: General Moderators
Code: Select all
select something from somewhere where dateinsert>now()-interval 15 minute