Re: Last visitors (SOLVED?)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux