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 t7.cat_right<= AND t2.lang="geo" ORDER BY t1.date DESC LIMIT 0,9' at line 5 SELECT t1.*, t2.title, t2.intro, t7.name as category_name, t7.cat_id as t7catid, t7.parent_id,t7.cat_level level FROM cms_prod t1 LEFT JOIN cms_prod_info t2 ON t1.id = t2.rec_id LEFT JOIN cms_categories t7 ON t1.cat_id = t7.cat_id WHERE t1.publish=1 AND t7.cat_left>= AND t7.cat_right<= AND t2.lang="geo" ORDER BY t1.date DESC