NeilFawcett Posted March 10, 2017 Share Posted March 10, 2017 I have a PHP script which we use with VBulletin. The script works under PHP 5.3, but when we change to PHP 5.5 the code produces a "database error."The line it happens on is:- $db->connect( $config['Database']['dbname'], $config['MasterServer']['servername'], $config['MasterServer']['port'], $config['MasterServer']['username'], $config['MasterServer']['password'], $config['MasterServer']['usepconnect'], $config['SlaveServer']['servername'], $config['SlaveServer']['port'], $config['SlaveServer']['username'], $config['SlaveServer']['password'], $config['SlaveServer']['usepconnect'], $config['Mysqli']['ini_file'] I'm hoping quite simply that for PHP 5.5 that command needs to be altered in someway?Thanks for any help...ps: Preceding that code is the following in case it's important:- switch (strtolower($config['Database']['dbtype'])) { // load standard MySQL class case 'mysql': case '': { $db =& new vB_Database($vbulletin); break; } // load MySQLi class case 'mysqli': { $db =& new vB_Database_MySQLi($vbulletin); break; } // load extended, non MySQL class default: { die('Fatal error: Database class not found'); } } Quote Link to comment Share on other sites More sharing options...
Jacques1 Posted March 10, 2017 Share Posted March 10, 2017 (edited) The script works under PHP 5.3, but when we change to PHP 5.5 the code produces a "database error." What is the specific error message? Open the PHP error log (or whatever the application uses) and post the full message. MySQL connections don't just fail, there's always a detailed description of the reason. I also recommend you do some basic debugging before you hand over the problem. Like: Which of the two classes even gets loaded? The old “mysql” one? The new “mysqli” class? Are the connection parameters correct? Edited March 10, 2017 by Jacques1 Quote Link to comment Share on other sites More sharing options...
NeilFawcett Posted March 10, 2017 Author Share Posted March 10, 2017 Some by brute force and a lot of ignorance I've fixed it Seems under PHP5.5 it has to use the mysqli case! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.