I'm making chat room in my site but i'm having problem with the recent messages from the user in the database, i need to know if the user online or offline how can i know that by PHP to clear the data after he signout or offline?
The only way you could do that is by using a MySQL DataBase
1) when the user logs in, update the ''status' row to 'online' and insert the time the user logged in into 'login_time'
1.2)Run mysql query to check if the status is 'online'
1.3) code for online user --
2)When the user logs out (if he/she logs out) update 'status' to 'offline'
2.1)if user doesnt log out: run script (1.2) if user is 'online' check to see if 'login_time' was over an hour ago and if so update 'status' to 'offline' and run appropriate script.