简体   繁体   中英

Pear MDB2 not found ~ using PHP with FastCGI

I am getting the following error:

Fatal error: Call to undefined method MDB2_Error::quoteIdentifier() The full error is this: Fatal error: Call to undefined method MDB2_Error::quoteIdentifier() in /u01/www/givebutton.net/htdocs/lib/OA/Upgrade/VersionController.php on line 51

The environment is this: PHP 5.3.6-pl0-gentoo (cli) (built: Aug 23 2011 12:37:13) I am using fastcgi and nginx ...


Solution My problem was that the user was unable to log into the database. I fixed that and poof no more error. The full code

    function init($oDbh='')
    {
        $this->oDbh = $oDbh;
        $this->versionTablename = $oDbh->quoteIdentifier($GLOBALS['_MAX']['CONF']['table']['prefix'].'application_variable', true);
    }

As you see $oDbh is a database connection, and the user was not able to login to the database remotely. Fixed the perms in mysql, and it works.

Thanks for the help!

So MDB2_Error does not have the method quoteIdentifier . It is most probably that you tend to get the MDB2 handler but MDB2_Error has returned. Please write some check error code to prevent this.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM