hi hope you are all fine.
When user login in my web site the table update in database that the user is online and when they click on logout the table updated in database that the user is offline, it working fine but the problem is that when user login and close the browser without logout their account and my table show that the user is online but i want that when user close the broswer withot logout their account the table updated that this user is now offline tell me how can i do this.
<script type="text/javascript">
function update(){
<?php mysql_query("update reg set status = 'offline'") ;?>
}
window.unload = update();
</script>
i m doing this but it is not working now tell me the solution waiting for your reply.
thanks in advance.