Re: DB_Pager doesnt work with MDB
| From: | electroteque | Date: | Tue, 04 Jan 2005 08:12:36 +0000 |
| Subject: | Re: DB_Pager doesnt work with MDB | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-16577@lists.php.net to get a copy of this message | ||
There are two types of examples one on the pear site which doesnt have newlines, and an outdated version on the linked website.
result = $db->limitQuery("select * from assets",0,10);
$data = DB_Pager::getData(0, 10, $result->numRows());
print_r($data);
I will need to create a subclass to build the navigation as all this does is creates an array of next and previous. What i am finding odd is i have to give a limit to the limitQuery, then the numrows of the limit to db pager which ends up being 10 not 100 because of the limit therefore pager only calculates the 10 , am I also having to calculate $_GET['page'] * 10 as the from parameter in the getData method ? Its pretty silly shouldnt have to give logic to the method :| I guess i'll have to subclass it to customise the input and output, I get whats its doing though, i'll also have to calculate the total before a limitQuery looks like.
On 04/01/2005, at 6:29 PM, Justin Patrin wrote:
On Tue, 4 Jan 2005 18:13:42 +1100, electroteque <daniel@electroteque.org> wrote:Hi list, I am having issues getting DB_Pager to work with MDB, also how can I get pager to work with proper paging like page=2 and it calculate it rather than programatically calculating the start and limit to give to limitQuery ? Will I have to create a subclass to do this ?DB_Pager doesn't work with MDB because MDB is not DB. Check the examples for pager. There's one which does paging with DB that you should be easily able to alter for MDB. -- Justin Patrin -- PEAR General Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php