That's why if you look at it I'm calling the ceil() function.

-MI

-----Mensaje original-----
De: [email protected] [mailto:[EMAIL PROTECTED] En nombre
de [EMAIL PROTECTED]
Enviado el: Lunes, 27 de Noviembre de 2006 06:10 a.m.
Para: Cake PHP
Asunto: Re: How do I use 'offset' instead of 'page' in FindAll query?

Mariano Iglesias wrote:
> Thus,
>
> $offset = 20;
> $limit = 10;
>
> $this->Model->findAll($conditions, $fields, $order, $limit, ceil(1 +
> $offset/$limit));
>
> Just wanted to look smart
>
> -MI

Your example only works if the result of $offset/$limit is an integer.
You need to take the rounding function out.


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"Cake PHP" 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