SELECT * FROM fx_article_categories WHERE articleID = '' AND categoryID NOT IN(,7,8,9,10) ORDER BY artCatId ASC SELECT * FROM fx_article_categories WHERE articleID = '' AND categoryID NOT IN(,7,8,9,10) ORDER BY artCatId ASC You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '7,8,9,10) ORDER BY artCatId ASC' at line 1