On Fri, Apr 25, 2008 at 9:26 AM, Mark Lawton
<[EMAIL PROTECTED]> wrote:
>
> select price, name, 2 * protein + log(fibre) - 10 * salt - sugar - fat
> as health order by health limit 10
>
> Can somebody tell me how we would be able to do such lists in Cake,
> please?
Try this, but I must warn you I have not tested it.
$fields = array('price', 'name', '2 * protein + log(fibre) - 10 * salt
- sugar - fat as health');
$order = array('health' => 'desc');
$limit = 10;
$this->Foo->find('all', compact('fields', 'order', 'limit'));
Hope that helps.
--
Chris Hartjes
Internet Loudmouth
Motto for 2008: "Moving from herding elephants to handling snakes..."
@TheKeyBoard: http://www.littlehart.net/atthekeyboard
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---