How to find user online status in php

How to find user online status in php

When we are working with the web based application or web based chat application it is very important to know the users online status. This can be easily implemente by using jquery or javascript and php.

Below I have given the simple example which is written by jquery, php and mysql.

My table name is ” users “, I want to store the online users into the tables to check the avaliable user staus.

How to update the user status in database?

The jquery code

 The update.php [ PHP code ]

The above code will store the user id who are all logged into the website. Thats all for storing logged users in website.

How to list the user online status from database ?

Now lets retrieve the list of users who are “online.” from database

Jqury code

 The getList.php [ PHP code ]