Re: Daily stats (page hits) reporting with cake

2008-06-26 Thread Fahad
thanks for the code. will definitely try it :) On Jun 26, 6:13 pm, grigri <[EMAIL PROTECTED]> wrote: > Assuming you're using an auto-incrementing id, and entries are never > deleted, you could do this: > > SELECT d1.date,d2.date >   FROM hits h1 >   INNER JOIN hits h2 >     ON (h2.id=h1.id+1) >  

Re: Daily stats (page hits) reporting with cake

2008-06-26 Thread Fahad Ibnay Heylaal
thanks for the code. will definitely try it :) -- http://frinity.blogspot.com On Thu, Jun 26, 2008 at 6:13 PM, grigri <[EMAIL PROTECTED]> wrote: > > Assuming you're using an auto-incrementing id, and entries are never > deleted, you could do this: > > SELECT d1.date,d2.date > FROM hits h1 > I

Re: Daily stats (page hits) reporting with cake

2008-06-26 Thread grigri
Assuming you're using an auto-incrementing id, and entries are never deleted, you could do this: SELECT d1.date,d2.date FROM hits h1 INNER JOIN hits h2 ON (h2.id=h1.id+1) WHERE h1.date<>h2.date AND TO_DAYS(h2.date)-TO_DAYS(h1.date)>1 cakeified: class Hit extends AppModel { funct

Re: Daily stats (page hits) reporting with cake

2008-06-26 Thread Fahad
actually, 'page stats' is only an example. i need it mainly for tracking external referral links. i have coded a complete statcounter.com clone back in 2005 - but couldnt run it well because the server became super busy! now i am totally in love with cake, and want to build everything with it. O

Re: Daily stats (page hits) reporting with cake

2008-06-26 Thread Dr. Tarique Sani
On Thu, Jun 26, 2008 at 5:25 PM, dr. Hannibal Lecter <[EMAIL PROTECTED]> wrote: > > I know this probably won't answer your question, but here goes > anyway.. > > If possible, why not use Google Analytics? May be they are working on a Google Analytics killer ;) T -- ==

Re: Daily stats (page hits) reporting with cake

2008-06-26 Thread dr. Hannibal Lecter
I know this probably won't answer your question, but here goes anyway.. If possible, why not use Google Analytics? On Jun 26, 12:30 pm, Fahad <[EMAIL PROTECTED]> wrote: > hi, > i am currently working on a site that requires reporting daily hits of > its web pages. > this is the SQL structure > =

Re: Daily stats (page hits) reporting with cake

2008-06-26 Thread Dr. Tarique Sani
Either select and post process in PHP or Use a second table (temp?) which has the entire date range and do a join on that table... AFAIR the SQL Cookbook had a similar recipe Tarique On Thu, Jun 26, 2008 at 4:00 PM, Fahad <[EMAIL PROTECTED]> wrote: > > hi, > i am currently working on a site t

Daily stats (page hits) reporting with cake

2008-06-26 Thread Fahad
hi, i am currently working on a site that requires reporting daily hits of its web pages. this is the SQL structure table : hits id, page_id, hits, date (-mm-dd) there is a possibility that there will be days when the site receives no hits at all. therefore, no reco