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 that requires reporting daily hits of > its web pages. > this is the SQL structure > ============ > table : hits > id, page_id, hits, date (yyyy-mm-dd) > ============ > > > there is a possibility that there will be days when the site receives > no hits at all. therefore, no record will be stored for that 'date' in > the hits table. and the table may look like this (assume i am > recording stats only for the page with id #1): > ======= > table : hits (with records) > id, page_id, hits, date > 1, 1, 4, 2008-06-22 > 2, 1, 7, 2008-06-23 > 3, 1, 5, 2008-06-26 (notice the gap of 2 days) > ======= > > is there any way how i can get the missing days values (hits value > will be set to 0) via model (probably using a behaviour)? > > thanks > > > -- ============================================================= Cheesecake-Photoblog: http://cheesecake-photoblog.org PHP for E-Biz: http://sanisoft.com ============================================================= --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
