summaryrefslogtreecommitdiffstats
path: root/system/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'system/drivers')
-rw-r--r--system/drivers/DB_mysqli.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/system/drivers/DB_mysqli.php b/system/drivers/DB_mysqli.php
index 8bea60444..49adb5cc3 100644
--- a/system/drivers/DB_mysqli.php
+++ b/system/drivers/DB_mysqli.php
@@ -89,7 +89,12 @@ class CI_DB_mysqli extends CI_DB {
{
$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;
}