From 7591faf97bc152e385a154ffdf3c6a75d6b74bc9 Mon Sep 17 00:00:00 2001 From: admin Date: Sun, 22 Oct 2006 03:13:22 +0000 Subject: --- system/database/DB_result.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/system/database/DB_result.php b/system/database/DB_result.php index 7553c167f..5c8b4c3ae 100644 --- a/system/database/DB_result.php +++ b/system/database/DB_result.php @@ -63,11 +63,14 @@ class CI_DB_result { return $this->result_object; } - if ($this->num_rows == 0) + // In the event that query caching is on the result_id variable + // will return FALSE since there isn't a valid SQL resource so + // we'll simply return an empty array. + if ($this->result_id === FALSE) { return array(); } - + $this->_data_seek(0); while ($row = $this->_fetch_object()) { @@ -92,7 +95,10 @@ class CI_DB_result { return $this->result_array; } - if ($this->num_rows == 0) + // In the event that query caching is on the result_id variable + // will return FALSE since there isn't a valid SQL resource so + // we'll simply return an empty array. + if ($this->result_id === FALSE) { return array(); } -- cgit v1.2.3-24-g4f1b