mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 22:28:51 +00:00
Oops, I forgot the negate bit in sql_in_set()
git-svn-id: file:///svn/phpbb/trunk@6262 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
d8af8223cd
commit
9086adad3c
1 changed files with 3 additions and 3 deletions
|
@ -285,7 +285,7 @@ class dbal
|
||||||
return $query;
|
return $query;
|
||||||
}
|
}
|
||||||
|
|
||||||
function sql_in_set($field, $array)
|
function sql_in_set($field, $array, $negate = false)
|
||||||
{
|
{
|
||||||
if (!sizeof($array))
|
if (!sizeof($array))
|
||||||
{
|
{
|
||||||
|
@ -320,11 +320,11 @@ class dbal
|
||||||
|
|
||||||
if (sizeof($values) == 1)
|
if (sizeof($values) == 1)
|
||||||
{
|
{
|
||||||
return $field . ' = ' . $values[0];
|
return $field . ($negate ? ' <> ' : ' = ') . $values[0];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return $field . ' IN (' . implode(',', $values) . ')';
|
return $field . ($negate ? ' NOT IN ' : ' IN ' ) . '(' . implode(',', $values) . ')';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue