Re: MDB2_Driver_pgsql::limitQuery()
| From: | Lukas Kahwe Smith | Date: | Wed, 18 Oct 2006 20:45:17 +0000 |
| Subject: | Re: MDB2_Driver_pgsql::limitQuery() | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-25539@lists.php.net to get a copy of this message | ||
Lorenzo Alberton wrote:
Paul Scott wrote:actually there is .. but since its inferior to using setLimit() its been relegated to the extended module: $mdb2->loadModule('Extended'); $mdb2->extended->limitQuery($sql);When calling limitQuery() on a postgres connection, I get the following error, although it seems to be ok with the same code on a MySQL5.1.x database: Fatal error: Call to undefined function: MDB2_Driver_pgsql::limitQuery(). in /usr/share/php/MDB2.php on line 1917 Is this a bug? Should I write a limitQuery() for pgsql and submit a patch? Am I just missing something?there's no such method.
You should use setLimit() and then query*(): http://pear.php.net/manual/en/package.database.mdb2.intro-query.php#package.database.mdb2.intro-query.setlimityup setLimit() is what you want .. you can call it before _any_ querying method and that limit/offset will be applied to the first query run after that call. regards, Lukas