WordPress.org

Make WordPress Core


Ignore:
Timestamp:
05/27/2011 03:46:56 PM (8 years ago)
Author:
ryan
Message:

Properly handle return value of DDL statements. Props scribu, marcis20. fixes #11372

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/wp-db.php

    r18011 r18063  
    10831083        }
    10841084
    1085         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 ) ) {
    10861088            $this->rows_affected = mysql_affected_rows( $this->dbh );
    10871089            // Take note of the insert_id
    1088             if ( preg_match( "/^\\s*(insert|replace) /i", $query ) ) {
     1090            if ( preg_match( '/^\s*(insert|replace) /i', $query ) ) {
    10891091                $this->insert_id = mysql_insert_id($this->dbh);
    10901092            }
Note: See TracChangeset for help on using the changeset viewer.