Improved the function "oracle_db_format_array_where_clause_sql" by adding more checks

This commit is contained in:
Alejandro Gallardo Escobar 2015-06-10 17:39:46 +02:00
parent b02d381205
commit 5751666f45
1 changed files with 15 additions and 3 deletions

View File

@ -654,16 +654,28 @@ function oracle_db_format_array_where_clause_sql ($values, $join = 'AND', $prefi
else { else {
if ($value[0] == ">") { if ($value[0] == ">") {
$value = substr($value,1,strlen($value)-1); $value = substr($value,1,strlen($value)-1);
$query .= sprintf ("%s > '%s'", $field, $value);
if (is_nan($value))
$query .= sprintf ("%s > '%s'", $field, $value);
else
$query .= sprintf ("%s > %s", $field, $value);
} }
else if ($value[0] == "<") { else if ($value[0] == "<") {
if ($value[1] == ">") { if ($value[1] == ">") {
$value = substr($value,2,strlen($value)-2); $value = substr($value,2,strlen($value)-2);
$query .= sprintf ("%s <> '%s'", $field, $value);
if (is_nan($value))
$query .= sprintf ("%s <> '%s'", $field, $value);
else
$query .= sprintf ("%s <> %s", $field, $value);
} }
else { else {
$value = substr($value,1,strlen($value)-1); $value = substr($value,1,strlen($value)-1);
$query .= sprintf ("%s < '%s'", $field, $value);
if (is_nan($value))
$query .= sprintf ("%s < '%s'", $field, $value);
else
$query .= sprintf ("%s < %s", $field, $value);
} }
} }
else if ($value[0] == '%') { else if ($value[0] == '%') {