Search code examples
phpmysqlpear

Updating an old site from DB to MDB2 connection, getting a lot of call to undefined function errors


Migrated an old site to our server, which was using DB to connect (PEAR)

Updated to MDB2 , downloaded and installed the packages and mysql driver, and now the site is throwing errors like

Call to undefined function: MDB2_Driver_mysql::execute()

and

Call to undefined method MDB2_Error::execute()

and

Call to undefined method MDB2_Error::numRows()

Is there something I've missed here ?


Solution

  • The MDB2_Error class does not have execute or numRows methods, so it is very likely than the MDB2 driver is returning an instance of that class to indicate an error coming back from your RDBMS. I'd recommend you check over your code and ensure that it handles errors appropriately.

    More details on how you could do this in your code are in the manual pages for MDB2.