hi all
please i need idea or code to implement this target
i need to know
How many users currently life connected to my site?
Thanks all
How many users currently life connected
Moderator: General Moderators
Re: How many users currently life connected
Every time someone connects to the site, or clicks a link on the site, update a database table to record the time of the click and their user id (or session id). To get the number of users you just need to query the number of unique ids that have been updated in the last few minutes.
Re: How many users currently life connected
thanks onion2k for your replay 
i understand from your answer that i will use specified time ex: 3 minutes
but if the user will signed in for 10 minutes then his record not changed
so our counter will be wrong
i understand from your answer that i will use specified time ex: 3 minutes
but if the user will signed in for 10 minutes then his record not changed
so our counter will be wrong
Re: How many users currently life connected
Use 10 minutes instead of 3 minutes then.
You'll never make a completely accurate counter. It's not possible.
You'll never make a completely accurate counter. It's not possible.
Re: How many users currently life connected
Also you can use JavaScript based on Ajax which will send request on your site and refresh the session