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

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

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 !!!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.