No, I want to update it every 5 minutes to prevent wasting of resource!!
because your method is updating every time the user load anypage and that will make big traffic. while what I want to do is updating the database record every 5 minutes until if the user load many pages, the system will update the online record only every 5 minutes and once. but I don't know how to do it, because the counter in one page will differ from the counter in the other page (suppose that the counter will be made in javascript). because of that I want to see if there is another more efficient way or at least how to implement my idea.
thank's