From 54bde739e6852c683ab438d49361ea937add857c Mon Sep 17 00:00:00 2001 From: "Namhyeon, Go" Date: Mon, 21 Oct 2019 11:05:30 +0900 Subject: [PATCH] Update database.php --- system/database.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/system/database.php b/system/database.php index cd2843c..e12af6e 100644 --- a/system/database.php +++ b/system/database.php @@ -230,6 +230,15 @@ if(!check_function_exists("exec_db_fetch_all")) { $rows = $stmt->fetchAll(PDO::FETCH_ASSOC); } + // 1.6 or above + $_rows = array(); + if(array_key_equals("getvalues", $options, true)) { + foreach($rows as $row) { + $_rows[] = array_values($row); + } + $rows = $_rows; + } + if(array_key_equals("do_count", $options, true)) { $_sql = sprintf("select count(*) as cnt from (%s) a", get_db_binded_sql($sql, $bind)); $_data = exec_db_fetch($_sql); @@ -242,15 +251,6 @@ if(!check_function_exists("exec_db_fetch_all")) { $response = $rows; $is_not_countable = true; } - - // 1.6 or above - $_rows = array(); - if(array_key_equals("getvalues", $options, true)) { - foreach($rows as $row) { - $_rows[] = array_values($row); - } - $rows = $_rows; - } if(!$is_not_countable) { $response = array(