0

I am upgrading a site from Fedora 14, PHP4, and PEAR DB to Fedora 16, PHP 5.4 and PEAR MDB2 2.5.0b3, and I am getting the error

Fatal error: Call to undefined function: MDB2_Driver_MYSQL::getAll(). in /usr/share/php/MDB2.php on line 1892

Obviously, I've checked line 1892 of the MDB2.php file, and it contains the error reporting code for the __call magic method (allows you to call a specific function by passing it into __call)

I have checked for usages of __call, and there don't seem to be any. Likewise, when I try to find where MDB2_Driver_MYSQL is coming from, the only place it is even mentioned is in MDB2.php (as a comment about the driver for MySQL), in the class declaration (class MDB2_Driver_mysql extends MDB2_Driver_Common), and the description title in the .xml file.

I have manually included the /usr/share/php/MDB2/Extended.php file in the file where the MDB2_Driver_mysql class is defined, and that didn't help (not that this would have been a permanant fix...)

Has anyone encountered this error, and if so, what did you do to fix it? Google has proved nearly useless, as the only place it is specifically mentioned doesn't really deal with fixing it.

jprofitt
  • 10,874
  • 4
  • 36
  • 46
jakimfett
  • 381
  • 4
  • 5

2 Answers2

1

change getAll() in your class, to queryAll(), cause there some difference between DB & MDB2, and the same with getOne, getRow - they all changed to queryOne, queryRow. Here you can read about it http://www.phpied.com/db-2-mdb2/

kxc
  • 1,357
  • 2
  • 16
  • 39
0

Make sure you load the extended module in your code prior to making a query, similar to below:

$db->loadModule('Extended');
Jim T.
  • 69
  • 4
  • Between the comment by Raffael above and this here, I attempted to load the extended module in a variety of ways, none of which made any difference (even when loaded as part of the MDB2::connect function). The weird thing is, the getAll call works with MDB2, just not with MDB2_Driver_MYSQL – jakimfett Apr 18 '12 at 20:07