Update database.php

This commit is contained in:
Namhyeon Go 2019-10-16 19:59:14 +09:00 committed by GitHub
parent b650be47fd
commit 52e9012a14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -378,6 +378,26 @@ if(!check_function_exists("get_bind_to_sql_where")) {
} else {
$s3 .= sprintf(" %s (%s like %s)", $opts[0], get_value_in_array($opts[1][1], $s1a, $opts[1][1]), "'%{$opts[1][2]}%'");
}
} elseif($opts[1][0] == "left") {
if(check_array_length($opts[1][2], 0) > 0) {
$s3a = array();
foreach($opts[1][2] as $word) {
$s3a[] = sprintf("%s like '%s'", get_value_in_array($opts[1][1], $s1a, $opts[1][1]), "{$word}%");
}
$s3 .= sprintf(" %s (%s)", $opts[0], implode(" and ", $s3a));
} else {
$s3 .= sprintf(" %s (%s like %s)", $opts[0], get_value_in_array($opts[1][1], $s1a, $opts[1][1]), "'{$opts[1][2]}%'");
}
} elseif($opts[1][0] == "right") {
if(check_array_length($opts[1][2], 0) > 0) {
$s3a = array();
foreach($opts[1][2] as $word) {
$s3a[] = sprintf("%s like '%s'", get_value_in_array($opts[1][1], $s1a, $opts[1][1]), "%{$word}");
}
$s3 .= sprintf(" %s (%s)", $opts[0], implode(" and ", $s3a));
} else {
$s3 .= sprintf(" %s (%s like %s)", $opts[0], get_value_in_array($opts[1][1], $s1a, $opts[1][1]), "'%{$opts[1][2]}'");
}
} elseif($opts[1][0] == "in") {
if(check_array_length($opts[1][2], 0) > 0) {
$s3 .= sprintf(" %s (%s in ('%s'))", $opts[0], $opts[1][1], implode("', '", $opts[1][2]));