From 69c070237c0ac2cf860459bf7d79af2251b2e0bf Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Thu, 31 Jan 2008 22:09:17 +0000 Subject: [PATCH] Allow multiple db instances. Props Nazgul. fixes #2722 git-svn-id: https://develop.svn.wordpress.org/trunk@6701 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/wp-db.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wp-includes/wp-db.php b/wp-includes/wp-db.php index 5c5af7601f..4d8c437909 100644 --- a/wp-includes/wp-db.php +++ b/wp-includes/wp-db.php @@ -64,7 +64,7 @@ class wpdb { if ( defined('DB_COLLATE') ) $this->collate = DB_COLLATE; - $this->dbh = @mysql_connect($dbhost, $dbuser, $dbpassword); + $this->dbh = @mysql_connect($dbhost, $dbuser, $dbpassword, true); if (!$this->dbh) { $this->bail("

Error establishing a database connection

@@ -81,7 +81,7 @@ class wpdb { $this->ready = true; - if ( !empty($this->charset) && version_compare(mysql_get_server_info(), '4.1.0', '>=') ) + if ( !empty($this->charset) && version_compare(mysql_get_server_info($this->dbh), '4.1.0', '>=') ) $this->query("SET NAMES '$this->charset'"); $this->select($dbname); @@ -493,7 +493,7 @@ class wpdb { { global $wp_version; // Make sure the server has MySQL 4.0 - $mysql_version = preg_replace('|[^0-9\.]|', '', @mysql_get_server_info()); + $mysql_version = preg_replace('|[^0-9\.]|', '', @mysql_get_server_info($this->dbh)); if ( version_compare($mysql_version, '4.0.0', '<') ) return new WP_Error('database_version',sprintf(__('ERROR: WordPress %s requires MySQL 4.0.0 or higher'), $wp_version)); } @@ -504,7 +504,7 @@ class wpdb { */ function supports_collation() { - return ( version_compare(mysql_get_server_info(), '4.1.0', '>=') ); + return ( version_compare(mysql_get_server_info($this->dbh), '4.1.0', '>=') ); } /**