You ARE using MySQL, you are just using cake's wrapper functions.  If you
read about how to use GROUP BY, then you will see what you need to modify in
your find method to return the data that you want.

CakePHP's automagic can only do so much for you without a basic
understanding of the database you are working with.

On Mon, Nov 23, 2009 at 12:10 AM, death.au <death...@gmail.com> wrote:

> But I'm not using mysql, I am using the paginator helper's built in
> functions...
>
> On Nov 23, 4:00 pm, Dave <davidcr...@gmail.com> wrote:
> > In MySQL you use the GROUP BY keyword to accomplish this
> >
> > On Sun, Nov 22, 2009 at 7:44 PM, death.au <death...@gmail.com> wrote:
> > > I've been looking around, and haven't been able to find anything on
> > > this at all, and I was wondering if it was even possible to sort by a
> > > count of related models using the paginator.
> >
> > > Using the basic blog example, I would like to list all posts with the
> > > paginator, sorted by the number of comments. Is there any way to do
> > > this currently?
> >
> > > In future I would also like to sort by things like average rating and
> > > other aggregates, but I thought I'd begin with the basics.
> >
> > > --
> >
> > > You received this message because you are subscribed to the Google
> Groups
> > > "CakePHP" group.
> > > To post to this group, send email to cake-...@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > > cake-php+unsubscr...@googlegroups.com<cake-php%2bunsubscr...@googlegroups.com>
> <cake-php%2bunsubscr...@googlegroups.com<cake-php%252bunsubscr...@googlegroups.com>
> >
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/cake-php?hl=.
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-...@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com<cake-php%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/cake-php?hl=.
>
>
>

--

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-...@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=.


Reply via email to