summaryrefslogtreecommitdiffstats
path: root/system/database/DB_utility.php
diff options
context:
space:
mode:
Diffstat (limited to 'system/database/DB_utility.php')
-rw-r--r--system/database/DB_utility.php17
1 files changed, 14 insertions, 3 deletions
diff --git a/system/database/DB_utility.php b/system/database/DB_utility.php
index d7018bf2b..9533ec607 100644
--- a/system/database/DB_utility.php
+++ b/system/database/DB_utility.php
@@ -133,7 +133,11 @@ class CI_DB_utility {
}
$query = $this->db->query($sql);
- return current($query->result_array());
+ $res = $query->result_array();
+
+ // Note: Due to a bug in current() that affects some versions
+ // of PHP we can not pass function call directly into it
+ return current($res);
}
// --------------------------------------------------------------------
@@ -159,7 +163,10 @@ class CI_DB_utility {
$query = $this->db->query($sql);
// Build the result array...
- $res = current($query->result_array());
+ // Note: Due to a bug in current() that affects some versions
+ // of PHP we can not pass function call directly into it
+ $res = $query->result_array();
+ $res = current($res);
$key = str_replace($this->db->database.'.', '', current($res));
$keys = array_keys($res);
unset($res[$keys[0]]);
@@ -190,7 +197,11 @@ class CI_DB_utility {
}
$query = $this->db->query($sql);
- return current($query->result_array());
+
+ // Note: Due to a bug in current() that affects some versions
+ // of PHP we can not pass function call directly into it
+ $res = $query->result_array();
+ return current($res);
}
// --------------------------------------------------------------------