Re: [PHP] Last visitors (SOLVED?)

2005-04-19 Thread Christopher Fulton
> I did, the problem is the client is on a box with mySql 3.23.x or 4.0.x, he > is deciding to upgrade to a dedicated box but then the host he is looking at > says they will charge him if they are to upgrade to mysql 4.1 (hence i cant > even use sub-selects) > (Sorry I didnt mention the MySql versi

Re: [PHP] Last visitors (SOLVED?)

2005-04-19 Thread Ryan A
Hey, Thanks for replying. > Check my reply. I did, the problem is the client is on a box with mySql 3.23.x or 4.0.x, he is deciding to upgrade to a dedicated box but then the host he is looking at says they will charge him if they are to upgrade to mysql 4.1 (hence i cant even use sub-selects) (S

Re: [PHP] Last visitors (SOLVED?)

2005-04-19 Thread Mike Hummel
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

Re: [PHP] Last visitors (SOLVED?)

2005-04-19 Thread Petar Nedyalkov
On Tuesday 19 April 2005 17:03, 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

Re: [PHP] Last visitors (SOLVED?)

2005-04-19 Thread Ryan A
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 logi