I have an array which contains a bunch of ID:s...
I can't figure out how to write a query for finding all records which are NOT inside this array, in mysql.
SELECT * FROM main_table WHERE ..........
Any ideas?
Thanks
I have an array which contains a bunch of ID:s...
I can't figure out how to write a query for finding all records which are NOT inside this array, in mysql.
SELECT * FROM main_table WHERE ..........
Any ideas?
Thanks
Like this:
$str = implode(',', $your_array);
The above statements converts an array into comma-delimited string.
"SELECT * FROM main_table WHERE id NOT IN ('$str')"
More Info: