summaryrefslogtreecommitdiffstats
path: root/system/database/DB_result.php
diff options
context:
space:
mode:
Diffstat (limited to 'system/database/DB_result.php')
-rw-r--r--system/database/DB_result.php12
1 files 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();
}