Best way to list online users with PHP but without MySQL?
I want to make a script that will list online users when they enter a page. Simple way is record newly entered users into MySQL and list them for example every second. But I don't think it's a good idea with tons of users like in a facebook app come in and out of the page. There would be a way with Flash and PHP sockets but I really don't want to use Flash either. So is 开发者_C百科there any option left?
Maybe you can use Memcache to store the users' information such as sessions for large amount of frequent query.I think it's an easy and effective way to do your job.
Assuming you are using a login sistem so you have all the info you need stored somewhere in your database!
you can use sessions!
- http://php.net/manual/en/ref.session.php
here there is also a solution on stackoverflow
- Find Number of Open Sessions
精彩评论