0

this problem is too old with me
please try to help

I made online users table in db and when user is logging in . the code is


$sql="insert into online_users(username) values('".$_SEESION."')";
mysql_query($sql);

but I couldn't specify the users who went offline to delete them from the table
please help me

your friend
kareem,Egypt

3
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by phpuser
0

i guess if you use the date function to show/insert the date in YYYYMMDDHHMM format with the username .. then subtract the current time again in YYYYMMDDHHMM format from the login date and if the answer is more than 5 mins or whatever you want the users go offline after specific amount of time then delete the user from online users table

0

Hello,

Please review this http://elouai.com/users.php it will be helpful to you.

Actually you cant directly do it. you have to store last activity time in DB table and compare it with current time.

If different between that 2 times are greater than our defined time limit then delete that user record form DB or display that user as offline.

Please check link i paste above for more better idea.

Best luck !!!

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.