From 7acd581d9441fb8ada4c46c58f4ec30a01507506 Mon Sep 17 00:00:00 2001 From: admin Date: Mon, 23 Oct 2006 21:37:22 +0000 Subject: --- system/database/DB_utility.php | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'system/database/DB_utility.php') 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); } // -------------------------------------------------------------------- -- cgit v1.2.3-24-g4f1b