diff --git a/system/database/DB_result.php b/system/database/DB_result.php
index 7553c16..5c8b4c3 100644
--- a/system/database/DB_result.php
+++ b/system/database/DB_result.php
@@ -63,11 +63,14 @@
 			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 @@
 			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();
 		}