You want the total number of records? echo $paginator->params['paging']['Conference']['count'];
On Wed, Sep 2, 2009 at 1:51 AM, SuMiT KuMaR<[email protected]> wrote: > > Cakephp provides the function to get the count of a query with: > $this->Model->find("count") > > Also I have noticed that cakephp fires the count query to each query > that i execute. > > Questions: > 1. Is it because of the Pagination component/helper? > 2. How to get the result of the Count query? > > Here are the two queries: > SELECT COUNT(*) AS `count` FROM `conferences` AS `Conference` > LEFT JOIN `venues` AS `Venue` ON (`Conference`.`venue_id` = > `Venue`.`id`) > WHERE `Conference`.`date` >= '2009-09-01 21:37:35' > AND `Conference`.`status` = 1 > > SELECT * FROM `conferences` AS `Conference` > LEFT JOIN `venues` AS `Venue` ON (`Conference`.`venue_id` = > `Venue`.`id`) > WHERE `Conference`.`date` >= '2009-09-01 21:37:35' > AND `Conference`.`status` = 1 > ORDER BY `Conference`.`date` ASC > LIMIT 20 > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
