Ticket #41956: 41956.2.diff
File 41956.2.diff, 1.4 KB (added by , 7 years ago) |
---|
-
src/wp-includes/wp-db.php
1798 1798 $this->insert_id = 0; 1799 1799 return false; 1800 1800 } 1801 } 1802 1803 // If there is an error then take note of it. 1804 if ( $this->use_mysqli ) { 1805 if ( $this->dbh instanceof mysqli ) { 1806 $this->last_error = mysqli_error( $this->dbh ); 1801 } elseif ( 0 !== $mysql_errno ) { 1802 // If there is an error then take note of it. 1803 if ( $this->use_mysqli ) { 1804 if ( $this->dbh instanceof mysqli ) { 1805 $this->last_error = sprintf('[code:"%d", message:"%s"]' ,$mysql_errno, mysqli_error( $this->dbh ) ); 1806 } else { 1807 $this->last_error = __( 'Unable to retrieve the error message from MySQL' ); 1808 } 1807 1809 } else { 1808 $this->last_error = __( 'Unable to retrieve the error message from MySQL' ); 1810 if ( is_resource( $this->dbh ) ) { 1811 $this->last_error = sprintf('[code:"%d", message:"%s"]' ,$mysql_errno, mysql_error( $this->dbh ) ); 1812 } else { 1813 $this->last_error = __( 'Unable to retrieve the error message from MySQL' ); 1814 } 1809 1815 } 1810 } else {1811 if ( is_resource( $this->dbh ) ) {1812 $this->last_error = mysql_error( $this->dbh );1813 } else {1814 $this->last_error = __( 'Unable to retrieve the error message from MySQL' );1815 }1816 1816 } 1817 1817 1818 1818 if ( $this->last_error ) {