Update database.php
This commit is contained in:
parent
a269fd0ecd
commit
c030fe1fba
|
@ -132,7 +132,7 @@ if(!function_exists("exec_db_fetch_all")) {
|
|||
function exec_db_fetch_all($sql, $bind=array()) {
|
||||
$rows = array();
|
||||
$stmt = get_db_stmt($sql, $bind);
|
||||
|
||||
|
||||
if($stmt->execute() && $stmt->rowCount() > 0) {
|
||||
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
}
|
||||
|
@ -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 = "";
|
||||
|
|
Loading…
Reference in New Issue
Block a user