Check counterCache property - 
http://book.cakephp.org/view/78/Associations-Linking-Models-Together#belongsTo-81
- for your comments model $belongsTo definition.

On Jul 12, 5:05 pm, checcco <[email protected]> wrote:
> HI guys...i'm new to cakephp...i'm writing my first project and i'm
> having my first big issue:
>
> I have a simple blog...this blogs has obviously posts...each posts has
> many comments and comments belong to posts.
>
> How can i get posts ordered by number of comments?
>
> Please help me...i'd prefere not to write pure sql :(
>
> THanks everybody
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to