Update database.php
This commit is contained in:
parent
6295c19cbd
commit
fc30285fd0
|
@ -80,26 +80,23 @@ if(!check_function_exists("get_dbc_object")) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!check_function_exists("get_db_binded_param")) {
|
if(!check_function_exists("get_db_binded_param")) {
|
||||||
function get_db_binded_param($expression, $bind) {
|
function get_db_binded_param($exp, $bind) {
|
||||||
|
if($exp == (":" . $k)) {
|
||||||
foreach($bind as $k=>$v) {
|
foreach($bind as $k=>$v) {
|
||||||
if($expression == (":" . $k)) {
|
$exp = sprintf("'%s'", make_safe_argument($v));
|
||||||
$expression = sprintf("'%s'", make_safe_argument($v));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return $exp;
|
||||||
return $expression;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!check_function_exists("get_db_binded_sql")) {
|
if(!check_function_exists("get_db_binded_sql")) {
|
||||||
function get_db_binded_sql($sql, $bind) {
|
function get_db_binded_sql($sql, $bind) {
|
||||||
$d = explode(" ", $sql);
|
$exps = multi_str_split($sql, array(" ", "<>", ">=", "<=", "=", "(", ")", "\r\n", "\n", "\t"));
|
||||||
foreach($d as $k=>$v) {
|
foreach($exps as $k=>$v) {
|
||||||
$d[$k] = get_db_binded_param($v, $bind);
|
$exps[$k] = get_db_binded_param($v, $bind);
|
||||||
}
|
}
|
||||||
$sql = implode(" ", $d);
|
return implode("", $exps);
|
||||||
|
|
||||||
return $sql;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user