Jump to content

annoying php thing...


phpSensei

Recommended Posts

update people's last action time in a table, and pull everyone whose last action was, for example, less than 5 minutes ago.  consider a page view an "action."

 

if you want to save on some resources, set a minimum time interval between table updates, otherwise you'll be running an UPDATE on every single page visit for every single user.

Link to comment
https://forums.phpfreaks.com/topic/66384-annoying-php-thing/#findComment-332244
Share on other sites

i'm going to link you to four threads that cover exactly this topic:

 

http://www.phpfreaks.com/forums/index.php/topic,101955.0.html

 

http://www.phpfreaks.com/forums/index.php/topic,148226.0.html

 

http://www.phpfreaks.com/forums/index.php/topic,95397.0.html

 

http://www.phpfreaks.com/forums/index.php/topic,100488.0.html

 

i'm not going to post an example, simply because there's plenty of code and discussion in these threads (more than enough to get you on your way).

Link to comment
https://forums.phpfreaks.com/topic/66384-annoying-php-thing/#findComment-332258
Share on other sites

I understood everthing and I even added some of my own stuff...

 

One thing I don't understand. How would you attempt to do this with an ip adress. I you register the ip then update the mysql database, then you count the number of ip registered within the last 5 minutes, then 5 minutes later, how do you delete all the previous record at once?

Link to comment
https://forums.phpfreaks.com/topic/66384-annoying-php-thing/#findComment-332284
Share on other sites

See what I want to do, is register all the ip's that are viewing my site, then set the UNIX TIME thing, then count the number of registered ip's that keep coming in within 5 minutes, then if 5 minutes is passed, the time is reseted and the previous ip's are deleted.

Link to comment
https://forums.phpfreaks.com/topic/66384-annoying-php-thing/#findComment-332299
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.