Update database.php

This commit is contained in:
Namhyeon Go 2019-09-30 14:30:48 +09:00 committed by GitHub
parent e46b0195c2
commit b4b6a62ee7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -525,18 +525,21 @@ if(!check_function_exists("get_bind_to_sql_select")) {
}
}
// removed: get_bind_to_sql_update($tablename, $bind, $filters, $options) (lower than 1.6)
// current: get_bind_to_sql_update($tablename, $bind, $options) (1.6 or above)
if(!check_function_exists("get_bind_to_sql_update")) {
function get_bind_to_sql_update($tablename, $bind, $filters=array(), $options=array()) {
// process filters
function get_bind_to_sql_update($tablename, $bind, $options=array()) {
$excludes = array();
$bind_wheres = array();
foreach($bind as $k=>$v) {
if(!array_key_empty($k, $filters)) {
if($filters[$k] === true) {
// set keys
if(!array_key_empty("setkeys", $options)) {
$setkeys = $options['setkeys'];
foreach($bind as $k=>$v) {
if(in_array($k, $setkeys)) {
$bind_wheres[$k] = $v;
$excludes[] = $k;
} else {
$bind_wheres[$k] = $filters[$k];
}
}
}