diff --git a/system/drivers/DB_mysqli.php b/system/drivers/DB_mysqli.php
index 8bea604..49adb5c 100644
--- a/system/drivers/DB_mysqli.php
+++ b/system/drivers/DB_mysqli.php
@@ -89,7 +89,12 @@
 	{
 		$sql = $this->_prep_query($sql);	
 		$result = @mysqli_query($this->conn_id, $sql);
-		mysqli_next_result($this->conn_id);
+		
+		// We only advance the result pointer if there isn't an error
+		if (mysqli_errno($this->conn_id) == 0)
+		{
+			mysqli_next_result($this->conn_id);
+		}
 		return $result;
 	}