Grow your CSS skills. Land your dream job.

number of who is online with php and mysql !

  • # December 30, 2012 at 5:25 pm

    I wonder , how can i add number of online visitors to my site using php and mysql ?

    # January 1, 2013 at 9:54 am

    How do you currently handle logging in?

    If a user is logged in, I would normally assign a session id that is then expunged either on logout or after a set time period. You might do it differently.

    Either way, there should be something that is different between those who have a current session token and those who don’t. Use that to assist your count. If you need to handle large numbers of users, I strongly recommend having a separate table for logged in users, in which case you can simply count the number of rows.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".