Excluding results from an array, in a query
Posted: Mon Jan 24, 2005 4:16 pm
I have an array with ids
I have a query that needs to exclude those array ids
How?
I have a query that needs to exclude those array ids
How?
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
SELECT * FROM table WHERE id NOT IN('1','3','200','634')Code: Select all
if($f)
{$string = str_replace(',', '', $f);
$string = implode("', '", $string);
$string = substr("$string", 3);
$string = "AND f.fid NOT IN($string')";}