Update database.php
This commit is contained in:
parent
a5c10b94a9
commit
6dea7e0502
|
@ -47,9 +47,8 @@ if(!function_exists("get_dbc_object")) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!function_exists("get_db_stmt")) {
|
if(!function_exists("get_binded_sql")) {
|
||||||
function get_db_stmt($sql, $bind=array(), $bind_pdo=false, $show_sql=false) {
|
function get_binded_sql($sql, $bind) {
|
||||||
if(!$bind_pdo) {
|
|
||||||
if(count($bind) > 0) {
|
if(count($bind) > 0) {
|
||||||
$bind_keys = array_keys($bind);
|
$bind_keys = array_keys($bind);
|
||||||
|
|
||||||
|
@ -61,7 +60,14 @@ if(!function_exists("get_db_stmt")) {
|
||||||
$sql = str_replace(":" . $k, "'" . addslashes($bind[$k]) . "'", $sql);
|
$sql = str_replace(":" . $k, "'" . addslashes($bind[$k]) . "'", $sql);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return $sql;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!function_exists("get_db_stmt")) {
|
||||||
|
function get_db_stmt($sql, $bind=array(), $bind_pdo=false, $show_sql=false) {
|
||||||
|
$sql = !$bind_pdo ? get_binded_sql($sql, $bind) : $sql;
|
||||||
$stmt = get_dbc_object()->prepare($sql);
|
$stmt = get_dbc_object()->prepare($sql);
|
||||||
|
|
||||||
if($show_sql) {
|
if($show_sql) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user