Ticket #21870: 21870.diff
| File 21870.diff, 1.1 KB (added by nacin, 8 months ago) |
|---|
-
wp-includes/wp-db.php
1216 1216 $return_val = $this->rows_affected; 1217 1217 } else { 1218 1218 $num_rows = 0; 1219 while ( $row = @mysql_fetch_object( $this->result ) ) { 1220 $this->last_result[$num_rows] = $row; 1221 $num_rows++; 1219 if ( is_resource( $this->result ) ) { 1220 while ( $row = mysql_fetch_object( $this->result ) ) { 1221 $this->last_result[$num_rows] = $row; 1222 $num_rows++; 1223 } 1222 1224 } 1223 1225 1224 1226 // Log number of rows the query returned … … 1556 1558 * @access protected 1557 1559 */ 1558 1560 protected function load_col_info() { 1559 if ( $this->col_info )1561 if ( $this->col_info || ! is_resource( $this->result ) ) 1560 1562 return; 1561 1563 1562 for ( $i = 0; $i < @mysql_num_fields( $this->result ); $i++ ) {1563 $this->col_info[ $i ] = @mysql_fetch_field( $this->result, $i );1564 for ( $i = 0; $i < mysql_num_fields( $this->result ); $i++ ) { 1565 $this->col_info[ $i ] = mysql_fetch_field( $this->result, $i ); 1564 1566 } 1565 1567 } 1566 1568
