-
- $this->dbuser = $dbuser;
-
- $this->dbh = @mysql_connect( $dbhost, $dbuser, $dbpassword, true );
- if ( !$this->dbh ) {
- $this->bail( sprintf( /*WP_I18N_DB_CONN_ERROR*/"
-<h1>Error establishing a database connection</h1>
-<p>This either means that the username and password information in your <code>wp-config.php</code> file is incorrect or we can't contact the database server at <code>%s</code>. This could mean your host's database server is down.</p>
-<ul>
- <li>Are you sure you have the correct username and password?</li>
- <li>Are you sure that you have typed the correct hostname?</li>
- <li>Are you sure that the database server is running?</li>
-</ul>
-<p>If you're unsure what these terms mean you should probably contact your host. If you still need help you can always visit the <a href='http://wordpress.org/support/'>WordPress Support Forums</a>.</p>
-"/*/WP_I18N_DB_CONN_ERROR*/, $dbhost ), 'db_connect_fail' );
- return;
- }
-
- $this->ready = true;
-
- if ( $this->has_cap( 'collation' ) && !empty( $this->charset ) ) {
- if ( function_exists( 'mysql_set_charset' ) ) {
- mysql_set_charset( $this->charset, $this->dbh );
- $this->real_escape = true;
- } else {
- $query = $this->prepare( 'SET NAMES %s', $this->charset );
- if ( ! empty( $this->collate ) )
- $query .= $this->prepare( ' COLLATE %s', $this->collate );
- $this->query( $query );
- }
- }
-
- $this->select( $dbname, $this->dbh );