Re: "DB Error: syntax error" when using Pager, but no error when just query it using DB
| From: | Lorenzo Alberton | Date: | Mon, 03 Jan 2005 17:24:30 +0000 |
| Subject: | Re: "DB Error: syntax error" when using Pager, but no error when just query it using DB | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-16561@lists.php.net to get a copy of this message | ||
l Burnerheimerton wrote:
I am getting a DB:Syntax error with the code below. When I take out all the Pager stuff and change the variables in the LIMIT query to integers instead of the pager variables, it works fine. I dump the $pager and $offset variables which are arrays. Not sure how it passes arrays to a LIMIT query where it is expecting integers but...this was the exmaple supplied.if you want to paginate db records, please have a look at this file [1], it will make your life simpler. About your error: getOffsetByPageId() returns an ARRAY, not an integer. Please read the docs [2], they're fairly complete. HTH -- Lorenzo Alberton http://pear.php.net/user/quipo [1] http://cvs.php.net/co.php/pear/Pager/examples/Pager_Wrapper.php [2] http://pear.php.net/manual/en/package.html.pager.getoffsetbypageid.php