Jump to content

Recommended Posts

If you create your own user table, then when they log in update their id in the table to say logged in when they log out get it to change to logged out.

 

Then to see who is online

 

"SELECT * FROM userstable where onlinestatus = 'logged in';"

 

Is this what you mean?

As far as I know, unless you use persistent DB connections nobody will be connected to your mysql database (except when a query takes place).  If you're talking about sessions, then what I do is store the users session ID in a table and use session_set_save_handler to redirect session control to the database.  That way you can query the table to see how many sessions are active, based on last activity.

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.