Bill Karwin wrote:
-----Original Message-----
From: Dan Rossi [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 07, 2007 7:20 AM
To: Zend Framework
Subject: [fw-general] Core paging functionality for Zend_Db
Hi i was wondering if there was any functionality yet for
paging with Zend_Db.
You can use the "limitPage()" method in Zend_Db_Select. I just noticed
that this method is not documented, which I will fix shortly (ZF-1824).
The limitPage() method is like using the LIMIT clause, but instead of
count and offset arguments, the arguments of limitPage() are page number
and rows per page.
Here's an example that fetches rows 20-29. That is, the third page, if
pages are 10 rows each.
$select = $db->select()
->from('mytable')
->limitPage(3, 10);
Hi im already using this i consulted the API docs :)
I was talking view functionality of paging. It seems i also need to get
the count of results first in a different result before running limit as
usual. wonder if thats possible to be cached so the count isnt called on
each request. I may create a wrapper for pear pager instead.