Update database.php
This commit is contained in:
parent
8377fa6961
commit
539cd7e521
|
@ -313,6 +313,7 @@ if(!check_function_exists("get_bind_to_sql_insert")) {
|
||||||
function get_bind_to_sql_insert($tablename, $bind, $options=array()) {
|
function get_bind_to_sql_insert($tablename, $bind, $options=array()) {
|
||||||
$sql = "insert into `%s` (%s) values (:%s)";
|
$sql = "insert into `%s` (%s) values (:%s)";
|
||||||
|
|
||||||
|
// get not duplicatable fieldnames
|
||||||
$setduplicate = get_array(get_value_in_array("setduplicate", $options, false));
|
$setduplicate = get_array(get_value_in_array("setduplicate", $options, false));
|
||||||
|
|
||||||
// get number of duplicated rows
|
// get number of duplicated rows
|
||||||
|
@ -334,7 +335,7 @@ if(!check_function_exists("get_bind_to_sql_insert")) {
|
||||||
$num_duplicates = intval($row['cnt']);
|
$num_duplicates = intval($row['cnt']);
|
||||||
}
|
}
|
||||||
|
|
||||||
// make SQL statement
|
// make statements
|
||||||
if($num_duplicates > 0) {
|
if($num_duplicates > 0) {
|
||||||
$sql = get_bind_to_sql_update($tablename, $bind, array(
|
$sql = get_bind_to_sql_update($tablename, $bind, array(
|
||||||
"setkeys" => array_keys($_bind_F)
|
"setkeys" => array_keys($_bind_F)
|
||||||
|
@ -691,7 +692,7 @@ if(!check_function_exists("get_bind_to_sql_update")) {
|
||||||
// s3: make 'where' clause
|
// s3: make 'where' clause
|
||||||
$s3 = get_bind_to_sql_where($_bind_T, $options);
|
$s3 = get_bind_to_sql_where($_bind_T, $options);
|
||||||
|
|
||||||
// make completed sql statement
|
// make completed statements
|
||||||
$sql = get_db_binded_sql(sprintf("update %s set %s where %s", $s1, $s2, $s3), $bind);
|
$sql = get_db_binded_sql(sprintf("update %s set %s where %s", $s1, $s2, $s3), $bind);
|
||||||
|
|
||||||
return $sql;
|
return $sql;
|
||||||
|
@ -737,7 +738,6 @@ if(!check_function_exists("sql_query")) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// get timediff
|
// get timediff
|
||||||
if(!check_function_exists("get_timediff_on_query")) {
|
if(!check_function_exists("get_timediff_on_query")) {
|
||||||
function get_timediff_on_query($a, $b) {
|
function get_timediff_on_query($a, $b) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user