Re: Last visitors (SOLVED?)
| From: | Mike Hummel | Date: | Tue, 19 Apr 2005 14:32:04 +0000 |
| Subject: | Re: Last visitors (SOLVED?) | ||
| References: | 1 | Groups: | php.general php.general |
| Request: | Send a blank email to php-general+get-213371@lists.php.net to get a copy of this message | ||
just do a select limit 11
display up to 11... if less then 11, you might want to display them anyways.
you should be able to deal with up to a million + records, so select will stay quick, esp if you make the right fields indexed.
you can take care of purging via crons...
you might find you want the history in the end...
-m
Ryan A wrote:
Hey! I think I solved this: select 11 latest visitors count to see if it returned 11 records, if (count == 11){ get the oldest (of the 11) visitors time delete everything from that record and older than that } else{} Pros: max 2 queries If i am missing anything or you see any problem in my logic, please point it out. Thanks, Ryan