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 ') And i.id NOT IN(30453) ORDER BY i.id DESC LIMIT 0, 5' at line 1 SQL=SELECT i.id, i.title,i.alias,i.introtext, c.alias as catalias,c.id as catid FROM news_k2_items as i LEFT JOIN news_k2_categories c ON c.id = i.catid WHERE i.published = 1 and ( i.metakey like"%OMG%" OR i.metakey like"% Oh My God Review%" OR i.metakey like"% Oh My God first show%" OR i.metakey like"% Oh My God updates%" OR i.metakey like"% Oh My God Latest news%" OR i.metakey like"% Oh My God report%" OR i.metakey like"% Oh My God movie Rating%" OR i.metakey like"% Akshay Kumar%" OR i.metakey like"% Paresh Rawal%" OR i.metakey like"% Mithun Chakraborty%" OR) And i.id NOT IN(30453) ORDER BY i.id DESC LIMIT 0, 5