Update database.php
This commit is contained in:
parent
dc6a2c6a5c
commit
58dcdc3d73
|
|
@ -110,7 +110,7 @@ if(!function_exists("exec_db_query")) {
|
|||
}
|
||||
|
||||
// execute statement (insert->execute(bind) or if not, sql->bind->execute)
|
||||
$stmt_executed = $is_insert_with_bind ? @$stmt->execute($bind) : @$stmt->execute();
|
||||
$stmt_executed = $is_insert_with_bind ? $stmt->execute($bind) : $stmt->execute();
|
||||
|
||||
if($is_check_count == true) {
|
||||
if($stmt_executed && $stmt->rowCount() > 0) {
|
||||
|
|
@ -187,6 +187,17 @@ if(!function_exists("get_page_range")) {
|
|||
}
|
||||
}
|
||||
|
||||
if(!function_exists("get_bind_to_sql_where")) {
|
||||
// warning: variable k is not protected. do not use variable k and external variable without filter
|
||||
function get_bind_to_sql_where($bind) {
|
||||
$sql_where = "";
|
||||
foreach($bind as $k=>$v) {
|
||||
$sql_where .= " and {$k} = :{$k}";
|
||||
}
|
||||
return $sql_where;
|
||||
}
|
||||
}
|
||||
|
||||
// alias sql_query from exec_db_query
|
||||
if(!function_exists("sql_query")) {
|
||||
function sql_query($sql, $bind=array()) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user