WPDB: Before fetching results, make sure we have a valid result resource to fetch them from.
Fixes #27982. git-svn-id: https://develop.svn.wordpress.org/trunk@30677 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
5817aa262d
commit
6eebbc5750
@ -1668,12 +1668,12 @@ class wpdb {
|
|||||||
$return_val = $this->rows_affected;
|
$return_val = $this->rows_affected;
|
||||||
} else {
|
} else {
|
||||||
$num_rows = 0;
|
$num_rows = 0;
|
||||||
if ( $this->use_mysqli ) {
|
if ( $this->use_mysqli && $this->result instanceof mysqli_result ) {
|
||||||
while ( $row = @mysqli_fetch_object( $this->result ) ) {
|
while ( $row = @mysqli_fetch_object( $this->result ) ) {
|
||||||
$this->last_result[$num_rows] = $row;
|
$this->last_result[$num_rows] = $row;
|
||||||
$num_rows++;
|
$num_rows++;
|
||||||
}
|
}
|
||||||
} else {
|
} else if ( is_resource( $this->result ) ) {
|
||||||
while ( $row = @mysql_fetch_object( $this->result ) ) {
|
while ( $row = @mysql_fetch_object( $this->result ) ) {
|
||||||
$this->last_result[$num_rows] = $row;
|
$this->last_result[$num_rows] = $row;
|
||||||
$num_rows++;
|
$num_rows++;
|
||||||
|
Loading…
Reference in New Issue
Block a user