I used this article, did everything as it says, but I still need to know how to make it so that for registered users the name is written, who is online;
and here is the registration systemthat I used.
Make a table userswith a list of all users. In addition to the id,login,passtype fields, add the last_visitfield, the timestampfield type, write the default value current_timestampthere, it’s all in the database when creating a field, you can specify.
Now, in order to calculate how many people are online and get their data, we make a request:
$time=time(); $sql_sel='SELECT COUNT(t_user.id) AS `online_count`,t_user.* FROM `users` AS `t_user` WHERE last_time > $time-$wine';
This way you will get the number of online and their data in one request.
I think that it is not necessary to create another table for this, especially to calculate the number of online and load the database with unnecessary requests. just add one field to existing user db and query like this