Don't block SET NAMES query. Props g30rg3x for the find. fixes #5503 for 2.3

git-svn-id: http://svn.automattic.com/wordpress/branches/2.3@6463 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2007-12-22 06:24:10 +00:00
parent 555a11e1a1
commit b6b234927b
1 changed files with 3 additions and 1 deletions

View File

@ -78,11 +78,12 @@ class wpdb {
return;
}
$this->ready = true;
if ( !empty($this->charset) && version_compare(mysql_get_server_info(), '4.1.0', '>=') )
$this->query("SET NAMES '$this->charset'");
$this->select($dbname);
$this->ready = true;
}
function __destruct() {
@ -95,6 +96,7 @@ class wpdb {
*/
function select($db) {
if (!@mysql_select_db($db, $this->dbh)) {
$this->ready = false;
$this->bail("
<h1>Can&#8217;t select database</h1>
<p>We were able to connect to the database server (which means your username and password is okay) but not able to select the <code>$db</code> database.</p>