Re: Pager class problems
| From: | Tomas V.V.Cox | Date: | Tue, 04 Sep 2001 17:56:11 +0000 |
| Subject: | Re: Pager class problems | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-1803@lists.php.net to get a copy of this message | ||
On Tuesday 04 September 2001 22:49, Marc Logemann wrote:
> Hi,
>
> i cant get pager doing is work right :)
>
> ------------ snip ------------------
> $from = 0;
> $row_per_page = 10;
> $sql = "some sql";
>
> if (DB::isError($res = $db->query($sql))){
> die (DB::errorMessage($res));
> }
>
> $pager = new Pager ($res, $from, $rows_per_page);
> $data = $pager->build();
>
> if (DB::isError($data)){
> die (DB::errorMessage($data));
> }
>
> while ($row = $pager->fetchRow()){
> print_r($row);
> }
>
> --------------- snap ---------------
>
> $row in the while loop wont get any data back from
> fetchRow(). To be sure that the sql is ok i inserted
>
> while ($row = $res->fetchRow()) { print_r($row);}
>
> after the $db->query() and everything was fine. Is there
> version conflict perhaps? I use the DB class from 4.0.6
> and the Pager class was downloaded a few minutes ago.
>
> I cant see any mistakes... perhaps i am working too much...
> but perhaps its not my error :)
Are you using the Pear DB mysql extension? If so try a more recent
version of the file php4/pear/DB/mysql.php. See:
http://vulcanonet.com/soft/pager/ for more info in
this problem.
Tomas V.V.Cox