Jump to content

[SOLVED] Displaying users connected to mysql!


budimir

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.