Thanks everyone...
sasa
$new_array = implode("','", $array);
it works
echo $new_array
427','428
I tried it with P.id != '$new_array' and that works as well as with an empty array.
I also tried it with implode("''", $array);
it worked also
echo $new_array
427'428
jonsjava
$sql = "SELECT * FROM `table_name WHERE P.id NOT IN ({$exclude_list})";
If the array
is empty it doesn't work. " NOT IN ({$exclude_list}) "
It kills the select statement and nothing gets selected if the array (or list, whichever it is) is empty.
I tried it with P.id NOT IN ('$exclude_list') and it works
I tried it with P.id != '$exclude_list' and it works
both of the above yielded:
echo $exclude_list
'427', '428'
-----------------------
It seem that we have 3 or 4 ways to yield the same result. I will leave this as unsolved for a while if anyone would care to comment on which method is or isn't correct.
Thank again, Lance