I find several partial solutions in answers on this question, but common answer seems to be absent. So, I have a table users with columns user_id, user_name. On each static page of website I want to display all user names of users who currently view this page.
- Should I have a table views with columns user_id, webpage_link?
- If yes, when I shall update data in column webpage_link? How to connect code from following answer with mysql database Is there a way to detect if a browser window is not currently active? ? (If it is ok for this purpose.)
- To make updates very often is not very good. So, the user can view several pages (for example, in 2 or more tabs). What type of webpage_link column shall be in this case?