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:
Nils Adermann 2006-08-11 18:21:59 +00:00
parent d8af8223cd
commit 9086adad3c

View file

@ -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) . ')';
} }
} }