Pear Pager with ODBC - bug, or just me being stupid?
| From: | Simon H | Date: | Fri, 11 Jan 2002 19:59:34 +0000 |
| Subject: | Pear Pager with ODBC - bug, or just me being stupid? | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-655@lists.php.net to get a copy of this message | ||
I'm having trouble with the pager, when trying to run a while statement to
generate data below the pager itself.
I am using an Access DB on Windows for this one (hence ODBC), so I have
removed error checking and done manual $numrows. The pager displays and
works perfectly, its just when I try the fetchRow in the while statement:
Code
-----------
while ($row = $pager->fetchRow(DB_FETCHMODE_ASSOC))
{
echo "$row[Name]";
}
-----------
Error Message
-----------
Fatal error: Call to a member function on a non-object in
D:\php\pear\Pager.php on line 75
-----------
Pager.php line refered to
-----------
69 function fetchRow($mode=DB_FETCHMODE_DEFAULT)
70 {
71 $this->current++;
72 if ($this->current >= $this->top) {
73 return null;
74 }
75 return $this->res->fetchRow($mode, $this->current);
<<<<<<<<<<<<<
76 }
-----------
The "current" displays ok in the pager itself, so I dont see how this is
related.
Any ideas anyone?
TIA
Simon H