1

I am having trouble with MDB2_Iterator, this is an old project which is being moved to a new server.

The function in MDB2_Iterator for count() is below:

public function count()
{
    if ($this->result) {
        return $this->result->numRows();
    }
    return false;
}

$this->result is a MySql Resource and so numRows() fails.

Error:

Fatal error: Call to a member function numRows() on a non-object in /usr/share/pear/MDB2/Iterator.php on line 246

Anyone know how I can fix this?

Thanks.

Jake N
  • 10,535
  • 11
  • 66
  • 112
  • can you add the error message? – RageZ Dec 24 '11 at 13:43
  • Fatal error: Call to a member function numRows() on a non-object in /usr/share/pear/MDB2/Iterator.php on line 246 – Jake N Dec 24 '11 at 13:47
  • Result is not an object, so you search where result is set. – RageZ Dec 24 '11 at 13:49
  • @RageZ right of course. But rather than doing that and hunting through PEAR I thought I would post on here and attempt to find someone else who has had the same issue. – Jake N Dec 24 '11 at 14:43

0 Answers0