Click here to Skip to main content
15,913,610 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all. I have a website that has members log in. I store the members/users in a users table in a MySQL database. How can i on my website show a table with all the users currently logged in. The way i wanted to do it is have an extra table in the database that would store the currently logged in users but i am not allowed to do that. Does anyone know how to achieve this? Any help or links would be much appreciated. Thanking you in advance.
Posted
Comments
Thanks7872 17-May-13 5:49am    
You can alter your existing users table with adding column named ONLINE.by default make it false,when user logs in,make it true.Whenever user logs in,in table display all the users with ONLINE="true".When he logs out update the table with ONLINE="false".
Ruwaldo 17-May-13 5:51am    
Thanks for the comment. Will ask my IT head if i can do this. Is there no other way to do it without altering the database?

1 solution

There are built in methods for determining who is logged onto a MySql database - if you leave your users logged onto the database whilst they are on the site then you can use those tools

Have a look at these posts for further information

List of users accessing database[^]

How to see users logged into mysql[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900