Update database.php
This commit is contained in:
parent
44575179eb
commit
671aa580ba
|
@ -91,12 +91,14 @@ if(!function_exists("get_db_binded_sql")) {
|
||||||
function get_db_binded_sql($sql, $bind) {
|
function get_db_binded_sql($sql, $bind) {
|
||||||
if(is_array($bind) && check_array_length($bind, 0) > 0) {
|
if(is_array($bind) && check_array_length($bind, 0) > 0) {
|
||||||
$bind_keys = array_keys($bind);
|
$bind_keys = array_keys($bind);
|
||||||
|
if(is_array($bind_key) && check_array_length($bind_key, 0) > 0) {
|
||||||
|
// 2018-08-19: support lower php version (not supported anonymous function)
|
||||||
|
usort($bind_keys, "compare_db_key_length");
|
||||||
|
|
||||||
// 2018-08-19: support lower php version (not supported anonymous function)
|
// bind values
|
||||||
usort($bind_keys, "compare_db_key_length");
|
foreach($bind_keys as $k) {
|
||||||
|
$sql = str_replace(":" . $k, "'" . addslashes($bind[$k]) . "'", $sql);
|
||||||
foreach($bind_keys as $k) {
|
}
|
||||||
$sql = str_replace(":" . $k, "'" . addslashes($bind[$k]) . "'", $sql);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user