Reply
Sat 23 Apr, 2005 10:40 am
Hi,
I'm looking to make a feature for my website which shows how many users are active (or have been in the last 5 minutes).
In my database all user records have the date and time that a user last loaded a page (whilst logged in, obviously).
I only know the basics of sql, but how do I make a query that searches for dates from the last 5 minutes?
SELECT * FROM user_table WHERE last_logged_in_column > x;
x = current time - 5 minutes (or whatever period of time you choose to use to count a user as logged in).