Changes from branches/3.1/wp-includes/wp-db.php at r17547 to trunk/wp-includes/wp-db.php at r18110
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/wp-db.php
r17547 r18110 40 40 * It is possible to replace this class with your own 41 41 * by setting the $wpdb global variable in wp-content/db.php 42 * file with your class. You can name it wpdb also, since 43 * this file will not be included, if the other file is 44 * available. 42 * file to your class. The wpdb class will still be included, 43 * so you can extend it or simply use your own. 45 44 * 46 45 * @link http://codex.wordpress.org/Function_Reference/wpdb_Class … … 461 460 */ 462 461 var $func_call; 463 464 /**465 * Connects to the database server and selects a database466 *467 * PHP4 compatibility layer for calling the PHP5 constructor.468 *469 * @uses wpdb::__construct() Passes parameters and returns result470 * @since 0.71471 *472 * @param string $dbuser MySQL database user473 * @param string $dbpassword MySQL database password474 * @param string $dbname MySQL database name475 * @param string $dbhost MySQL database host476 */477 function wpdb( $dbuser, $dbpassword, $dbname, $dbhost ) {478 return $this->__construct( $dbuser, $dbpassword, $dbname, $dbhost );479 }480 462 481 463 /** … … 1031 1013 */ 1032 1014 function db_connect() { 1033 global $db_list, $global_db_list;1034 1035 1015 if ( WP_DEBUG ) { 1036 1016 $this->dbh = mysql_connect( $this->dbhost, $this->dbuser, $this->dbpassword, true ); … … 1103 1083 } 1104 1084 1105 if ( preg_match( "/^\\s*(insert|delete|update|replace|alter) /i", $query ) ) { 1085 if ( preg_match( '/^\s*(create|alter|truncate|drop) /i', $query ) ) { 1086 $return_val = $this->result; 1087 } elseif ( preg_match( '/^\s*(insert|delete|update|replace) /i', $query ) ) { 1106 1088 $this->rows_affected = mysql_affected_rows( $this->dbh ); 1107 1089 // Take note of the insert_id 1108 if ( preg_match( "/^\\s*(insert|replace) /i", $query ) ) {1090 if ( preg_match( '/^\s*(insert|replace) /i', $query ) ) { 1109 1091 $this->insert_id = mysql_insert_id($this->dbh); 1110 1092 } … … 1384 1366 // (Duplicates are discarded) 1385 1367 foreach ( $this->last_result as $row ) { 1386 $key = array_shift( $var_by_ref =get_object_vars( $row ) );1368 $key = array_shift( get_object_vars( $row ) ); 1387 1369 if ( ! isset( $new_array[ $key ] ) ) 1388 1370 $new_array[ $key ] = $row;
Note: See TracChangeset
for help on using the changeset viewer.