Update database.php
This commit is contained in:
parent
105073e0ec
commit
54bde739e6
|
@ -230,6 +230,15 @@ if(!check_function_exists("exec_db_fetch_all")) {
|
||||||
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
$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)) {
|
if(array_key_equals("do_count", $options, true)) {
|
||||||
$_sql = sprintf("select count(*) as cnt from (%s) a", get_db_binded_sql($sql, $bind));
|
$_sql = sprintf("select count(*) as cnt from (%s) a", get_db_binded_sql($sql, $bind));
|
||||||
$_data = exec_db_fetch($_sql);
|
$_data = exec_db_fetch($_sql);
|
||||||
|
@ -242,15 +251,6 @@ if(!check_function_exists("exec_db_fetch_all")) {
|
||||||
$response = $rows;
|
$response = $rows;
|
||||||
$is_not_countable = true;
|
$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) {
|
if(!$is_not_countable) {
|
||||||
$response = array(
|
$response = array(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user