|
|
 |
Re: FN-FORUM: Whose online script
date posted 3rd January 2008 09:29
I was wondering if anyone knew of an effective and efficient way of doing an whose online script in php. I need one for a community site I m building and not made one in a while.
Your basic option is to have a "last logged in" field and/or a "last
updated" field (both datetime) on the user table, and when the user logs
in, or does something, a brief function updates the "last updated"
field. Then the "Who's online" (note, not whose online) script just
does a Select based on the last updated field where the date difference
between now and the last updated is less than five minutes (or whatever
arbitrary time limit you put on it).
That should do it, although I'm sure other people will have better
options!
Alex
http://www.ozbon.com
|
 |
|