Changes in trunk/wp-includes/wp-db.php [4741:5195]
- File:
-
- 1 edited
-
trunk/wp-includes/wp-db.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/wp-db.php
r4741 r5195 36 36 var $postmeta; 37 37 38 var $charset; 39 var $collate; 40 38 41 /** 39 42 * Connects to the database server and selects a database … … 46 49 return $this->__construct($dbuser, $dbpassword, $dbname, $dbhost); 47 50 } 48 51 49 52 function __construct($dbuser, $dbpassword, $dbname, $dbhost) { 50 53 register_shutdown_function(array(&$this, "__destruct")); 54 55 if ( defined('DB_CHARSET') ) 56 $this->charset = DB_CHARSET; 57 58 if ( defined('DB_COLLATE') ) 59 $this->collate = DB_COLLATE; 51 60 52 61 $this->dbh = @mysql_connect($dbhost, $dbuser, $dbpassword); … … 64 73 } 65 74 75 if ( !empty($this->charset) && version_compare(mysql_get_server_info(), '4.1.0', '>=') ) 76 $this->query("SET NAMES '$this->charset'"); 77 66 78 $this->select($dbname); 67 79 } 68 80 69 81 function __destruct() { 70 return true; 82 return true; 71 83 } 72 84 … … 170 182 $this->result = @mysql_query($query, $this->dbh); 171 183 ++$this->num_queries; 172 184 173 185 if (SAVEQUERIES) 174 186 $this->queries[] = array( $query, $this->timer_stop() ); … … 181 193 182 194 if ( preg_match("/^\\s*(insert|delete|update|replace) /i",$query) ) { 183 $this->rows_affected = mysql_affected_rows( );195 $this->rows_affected = mysql_affected_rows($this->dbh); 184 196 // Take note of the insert_id 185 197 if ( preg_match("/^\\s*(insert|replace) /i",$query) ) { … … 244 256 if ( $query ) 245 257 $this->query($query); 246 258 247 259 if ( !isset($this->last_result[$y]) ) 248 260 return null; … … 361 373 header('Content-Type: text/html; charset=utf-8'); 362 374 363 if ( strstr($_SERVER['PHP_SELF'], 'wp-admin'))375 if (strpos($_SERVER['PHP_SELF'], 'wp-admin') !== false) 364 376 $admin_dir = ''; 365 377 else
Note: See TracChangeset
for help on using the changeset viewer.