I need to show a counter on some pages on my website in this format:
"X people are currently viewing this page."
My thoughts were:
Since I have access to phpmyadmin I could manually create a table in my DB.
When a person visit a page on my site I would like to add the number 1 in a mysql cell for that page in the table I created above.
When he leaves I would like to do a -1 on the same cell.
Naturally this would have to take in account all visitors on the site so, if, when visitor A enters, there are already 30 visitors, it should show 31 as the number "x" above.
It would be great if this were in AJAX and could update in real time.
Alternatively at the very least I could make do with a pure jquery or php solution to start with but I will ideally want to do it in AJAX.
Any thoughts, links or code help would be greatly appreciated.