Update database.php

This commit is contained in:
Namhyeon Go 2019-10-01 18:30:50 +09:00 committed by GitHub
parent 5a80fad2c7
commit fdbba15fbd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -531,14 +531,14 @@ 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)
// current: get_bind_to_sql_update($tablename, $bind, $options, $_options) (1.6 or above)
if(!check_function_exists("get_bind_to_sql_update")) {
function get_bind_to_sql_update($tablename, $bind, $options=array()) {
function get_bind_to_sql_update($tablename, $bind, $options=array(), $_options=array()) {
$excludes = array();
$bind_wheres = array();
// set keys
// setkeys
if(!array_key_empty("setkeys", $options)) {
$setkeys = $options['setkeys'];
foreach($bind as $k=>$v) {
@ -548,6 +548,11 @@ if(!check_function_exists("get_bind_to_sql_update")) {
}
}
}
// compatible version 1.5
if(!array_key_equals("compatible", $options, "1.5")) {
// todo
}
// make sql 'where' clause
$sql_where = get_db_binded_sql(get_bind_to_sql_where($bind_wheres), $bind_wheres);
@ -565,6 +570,8 @@ if(!check_function_exists("get_bind_to_sql_update")) {
}
}
function
if(!check_function_exists("get_bind_to_sql_delete")) {
function get_bind_to_sql_delete($tablename, $bind, $options=array()) {
$sql = "delete from %s where 1" . get_bind_to_sql_where($bind);