I have a datetime field in my MySql table where the date and time are recorded in the following format:
2010-12-17 18:06:59
I would like to select records where the datetime is in the last 15 minutes. How do I construct my query to do this?
I tried the following but it doesn't work:
// check in last 15 minutes
$time_duration = (15 * 60);
"SELECT COUNT(CounterId) AS Count FROM visitors_counter WHERE TimeStamp > NOW() - $time_duration"
Thanks!