Make WordPress Core


Ignore:
Timestamp:
01/31/2008 10:09:17 PM (17 years ago)
Author:
ryan
Message:

Allow multiple db instances. Props Nazgul. fixes #2722

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/wp-db.php

    r6469 r6701  
    6565            $this->collate = DB_COLLATE;
    6666
    67         $this->dbh = @mysql_connect($dbhost, $dbuser, $dbpassword);
     67        $this->dbh = @mysql_connect($dbhost, $dbuser, $dbpassword, true);
    6868        if (!$this->dbh) {
    6969            $this->bail("
     
    8282        $this->ready = true;
    8383
    84         if ( !empty($this->charset) && version_compare(mysql_get_server_info(), '4.1.0', '>=') )
     84        if ( !empty($this->charset) && version_compare(mysql_get_server_info($this->dbh), '4.1.0', '>=') )
    8585            $this->query("SET NAMES '$this->charset'");
    8686
     
    494494        global $wp_version;
    495495        // Make sure the server has MySQL 4.0
    496         $mysql_version = preg_replace('|[^0-9\.]|', '', @mysql_get_server_info());
     496        $mysql_version = preg_replace('|[^0-9\.]|', '', @mysql_get_server_info($this->dbh));
    497497        if ( version_compare($mysql_version, '4.0.0', '<') )
    498498            return new WP_Error('database_version',sprintf(__('<strong>ERROR</strong>: WordPress %s requires MySQL 4.0.0 or higher'), $wp_version));
     
    505505    function supports_collation()
    506506    {
    507         return ( version_compare(mysql_get_server_info(), '4.1.0', '>=') );
     507        return ( version_compare(mysql_get_server_info($this->dbh), '4.1.0', '>=') );
    508508    }
    509509
Note: See TracChangeset for help on using the changeset viewer.