Update database.php
This commit is contained in:
parent
ef49d3e940
commit
9ae6ab79e9
|
@ -89,16 +89,18 @@ if(!function_exists("compare_db_key_length")) {
|
||||||
|
|
||||||
if(!function_exists("get_db_binded_sql")) {
|
if(!function_exists("get_db_binded_sql")) {
|
||||||
function get_db_binded_sql($sql, $bind=array()) {
|
function get_db_binded_sql($sql, $bind=array()) {
|
||||||
$bind_keys = get_array(array_keys($bind));
|
$sql = "";
|
||||||
if(check_array_length($bind_keys, 0) > 0) {
|
|
||||||
// 2018-08-19: support lower php version (not supported anonymous function)
|
$bind_keys = get_array(array_keys($bind));
|
||||||
usort($bind_keys, "compare_db_key_length");
|
if(check_array_length($bind_keys, 0) > 0) {
|
||||||
|
// 2018-08-19: support lower php version (not supported anonymous function)
|
||||||
|
usort($bind_keys, "compare_db_key_length");
|
||||||
|
|
||||||
// bind values
|
// bind values
|
||||||
foreach($bind_keys as $k) {
|
foreach($bind_keys as $k) {
|
||||||
$sql = str_replace(":" . $k, "'" . addslashes($bind[$k]) . "'", $sql);
|
$sql = str_replace(":" . $k, "'" . addslashes($bind[$k]) . "'", $sql);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return $sql;
|
return $sql;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user