I would like to create a simple online offline status indicator that shows to browsing users if a user is online or offline. In my database I have a user tabel for every registed user I know I can simply add another colum at the end of the structure called status and have online idicated by a 1 and offline indicated by a 0. My problem is I'm very new to php and not sure how to.
A. Get the colum to update with either 1 or 0 every time a user logs on or off.
B. Get the table refresh back to 0 if a user forgets to log out and leaves the site
Can anyone give me some example code for this or does anyone have a base code to work with!