check this... http://book.cakephp.org/2.0/en/models/associations-linking-models-together.html?highlight=counter%20cache
find "counterCache" somewhere in the bottom of belongsTo association -- Lep pozdrav, Tilen Majerle http://majerle.eu 2011/10/25 Daniel <[email protected]> > Hello, > I have a categories view which lists associated posts at the bottom of > the screen. There is also a comments table. I would like to show a > count of comments for each post in the categories view, in a similar > manner to the following SQL: > SELECT count( * ) , post_id > FROM comments > GROUP BY post_id > > How do I code this? > > Thanks, > Daniel > > -- > Our newest site for the community: CakePHP Video Tutorials > http://tv.cakephp.org > Check out the new CakePHP Questions site http://ask.cakephp.org and help > others with their CakePHP related questions. > > > To unsubscribe from this group, send email to > [email protected] For more options, visit this group > at http://groups.google.com/group/cake-php > -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php
