致命错误:调用未定义函数:MDB2_Driver_MYSQL :: getAll() [英] Fatal error: Call to undefined function: MDB2_Driver_MYSQL::getAll()

查看:144
本文介绍了致命错误:调用未定义函数:MDB2_Driver_MYSQL :: getAll()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将网站从Fedora 14,PHP4和PEAR DB升级到Fedora 16,PHP 5.4和PEAR MDB2 2.5.0b3,但出现错误

致命错误:调用未定义函数:MDB2_Driver_MYSQL :: getAll().在1892行的/usr/share/php/MDB2.php中

很显然,我已经检查了MDB2.php文件的1892行,其中包含__call魔术方法的错误报告代码(允许您将其传递给__call来调用特定函数)

我检查了__call的用法,似乎没有任何用法.同样,当我尝试查找MDB2_Driver_MYSQL的来源时,甚至提到它的唯一地方是MDB2.php(作为MySQL驱动程序的注释),类声明(class MDB2_Driver_mysql extends MDB2_Driver_Common)和.xml文件中的描述标题.

我已经将/usr/share/php/MDB2/Extended.php文件手动包含在定义了MDB2_Driver_mysql类的文件中,但这没有帮助(不是说这将是一个永久性的修复方法...)

有人遇到此错误吗?如果是,您如何解决此错误?事实证明Google几乎没有用,因为它唯一的地方是专门提到的并没有真正解决它.

解决方案

将类中的getAll()更改为queryAll(),这会导致数据库和数据库之间存在一些差异. MDB2,以及与getOne,getRow相同的东西-它们都更改为queryOne,queryRow.在这里您可以阅读 http://www.phpied.com/db-2-mdb2/

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.

解决方案

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/

这篇关于致命错误:调用未定义函数:MDB2_Driver_MYSQL :: getAll()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆