Updated SQL generation logic in Model class.
* Found a bug with column values containing IS anywhere in the string. * Updated both the column check and value check to include a preceeding space (column) and trailing space (value) to correct the issue.
This commit is contained in:
parent
a6b992014b
commit
8146c2584d
1 changed files with 1 additions and 1 deletions
|
@ -131,7 +131,7 @@ class Model extends Object
|
|||
{
|
||||
$sql .= $column . ' IN ("' . implode($value, '", "') . '") ';
|
||||
}
|
||||
elseif (strpos($column, 'IS') === false && strpos($value, 'IS') === false)
|
||||
elseif (strpos($column, ' IS') === false && strpos($value, 'IS ') === false)
|
||||
{
|
||||
$sql .= $column . (preg_match('/(=|!=|<|>|LIKE)/', $column) ? ' ' : '= ') . ':';
|
||||
$column = trim(str_replace(array('!', '=', '<', '>', 'LIKE'), '', $column));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue