Update database.php

This commit is contained in:
Namhyeon Go 2018-03-19 02:27:05 +09:00 committed by GitHub
parent a269fd0ecd
commit c030fe1fba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -141,6 +141,24 @@ if(!function_exists("exec_db_fetch_all")) {
}
}
if(!function_exists("exec_db_fetch")) {
function exec_db_fetch($sql, $bind=array(), $bind_limit=true) {
$row = NULL;
$rows = array();
if($bind_limit == true) {
$sql = $sql . " limit 1";
}
$rows = exec_db_fetch_all($sql, $bind);
if(count($rows) > 0) {
$row = $rows[0];
}
return $row;
}
}
if(!function_exists("get_page_range")) {
function get_page_range($page=1, $limit=0) {
$append_sql = "";