@@ -64,7 +64,7 @@ function __construct($dbuser, $dbpassword, $dbname, $dbhost) {
6464 if ( defined ('DB_COLLATE ' ) )
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 ("
7070<h1>Error establishing a database connection</h1>
@@ -81,7 +81,7 @@ function __construct($dbuser, $dbpassword, $dbname, $dbhost) {
8181
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
8787 $ this ->select ($ dbname );
@@ -493,7 +493,7 @@ function check_database_version()
493493 {
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 ));
499499 }
@@ -504,7 +504,7 @@ function check_database_version()
504504 */
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
510510 /**
0 commit comments