Jump to content

Database error now with connect statement after moving from PHP 5.3 to 5.5?


Recommended Posts

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');

    }

}

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 by Jacques1
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.