Update database.php
This commit is contained in:
parent
e46b0195c2
commit
b4b6a62ee7
|
@ -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")) {
|
if(!check_function_exists("get_bind_to_sql_update")) {
|
||||||
function get_bind_to_sql_update($tablename, $bind, $filters=array(), $options=array()) {
|
function get_bind_to_sql_update($tablename, $bind, $options=array()) {
|
||||||
// process filters
|
|
||||||
$excludes = array();
|
$excludes = array();
|
||||||
$bind_wheres = array();
|
$bind_wheres = array();
|
||||||
|
|
||||||
|
// set keys
|
||||||
|
if(!array_key_empty("setkeys", $options)) {
|
||||||
|
$setkeys = $options['setkeys'];
|
||||||
foreach($bind as $k=>$v) {
|
foreach($bind as $k=>$v) {
|
||||||
if(!array_key_empty($k, $filters)) {
|
if(in_array($k, $setkeys)) {
|
||||||
if($filters[$k] === true) {
|
|
||||||
$bind_wheres[$k] = $v;
|
$bind_wheres[$k] = $v;
|
||||||
$excludes[] = $k;
|
$excludes[] = $k;
|
||||||
} else {
|
|
||||||
$bind_wheres[$k] = $filters[$k];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user