list of users online in a members site...
Moderator: General Moderators
-
The-Master
- Forum Commoner
- Posts: 45
- Joined: Sun Aug 07, 2005 9:51 am
- Location: Israel
list of users online in a members site...
hi, i want to make a list of users online on my site, but not the "there are X users online", i want to make a list of users online that are members of the site... the table of users is "users": "user" is the row with the users' nicks and ofcourse a "id" row for an id... (this is just like in phpBB stats on the forum's index)
make another table 'usersonline' with
and when an user logs in, insert a record into usersonline with userid and current time(), when the user moves around the site, update the stamp field with current time().
to remove any loged out users, just do
to show, just
good luck
Code: Select all
ID, userid, stampto remove any loged out users, just do
Code: Select all
DELETE FROM usersonline WHERE STAMP < 5 MINS ETCto show, just
Code: Select all
select users.username from users,usersonline where users.id = usersonline.userid