On Dec 18, 8:27 pm, Kyle Decot <[email protected]> wrote:
> I have a Skateparks Model and a Photos Model. I want to query the
> Skateparks model and get the number of skateparks that have 1 photos,
> 2 photos, etc. I'm not really sure how to go about this.
>
> Any help would be greatly appreciated. Thank you.
you would either use a group by
( in sql simply .. select park.* count(photo.id) from park left join
photo on ..)
or use counterCache
Group by and counterCache are both in the book.
hth
AD
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---