Jump to content

Recommended Posts

If your not to familiar with php, or php and mysql together my suggestion would google "PHP Useronline" you'll find a couple free scripts that you can either impliment or build off of, or learn from. Not to sound like I'm brushing you off.. but from ways ive seen it done in the past. It's not a simple task as it sounds.

Link to comment
https://forums.phpfreaks.com/topic/89126-users-online/#findComment-456452
Share on other sites

try doing something like this,

you should run this query on

all your pages that your

online users visit

 

mysql_query("UPDATE users SET last_active=NOW() WHERE id='". $_SESSION['id'] ."'");

 

be sure to edit the information to edit your information and to

create a column names last_active

 

then,

$query = mysql_query("SELECT * FROM users WHERE last_active > (NOW() - INTERVAL 5 MINUTE)");

 

that will get all your online users that have been online in the last 5 minutes,

if you want to get the information of each one, just use mysql_fetch_array()

Link to comment
https://forums.phpfreaks.com/topic/89126-users-online/#findComment-456589
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.