WordPress.org

Make WordPress Core

Ticket #27982: 27982.diff

File 27982.diff, 527 bytes (added by pento, 7 years ago)
  • src/wp-includes/wp-db.php

     
    15481548                        $this->last_error = mysql_error( $this->dbh );
    15491549                }
    15501550
    1551                 if ( $this->last_error ) {
     1551                if ( $this->last_error || ! is_object( $this->result ) ) {
    15521552                        // Clear insert_id on a subsequent failed insert.
    15531553                        if ( $this->insert_id && preg_match( '/^\s*(insert|replace)\s/i', $query ) )
    15541554                                $this->insert_id = 0;