1
   

PHP/MySQL 'users online' feature

 
 
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?
  • Topic Stats
  • Top Replies
  • Link to this Topic
Type: Discussion • Score: 1 • Views: 516 • Replies: 2
No top replies

 
Craven de Kere
 
  1  
Reply Mon 25 Apr, 2005 03:45 am
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).
0 Replies
 
NeonPaul
 
  1  
Reply Mon 25 Apr, 2005 05:00 am
thanks
0 Replies
 
 

Related Topics

Webdevelopment and hosting - Question by harisit2005
Showing an Ico File - Discussion by Brandon9000
how to earn money in internet - Discussion by rizwanaraj
The version 10 bug. Worse then Y2K! - Discussion by Nick Ashley
CSS Border style colors - Question by meesa
There is no Wisdom in Crowds - Discussion by ebrown p
THANK YOU CRAVEN AND NICK!!! - Discussion by dagmaraka
I'm the developer - Discussion by Nick Ashley
 
  1. Forums
  2. » PHP/MySQL 'users online' feature
Copyright © 2025 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.03 seconds on 01/18/2025 at 08:31:51