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 cat_right< AND hidden<>1 AND cat_level=2 AND pid=7 ORDER BY cat_left ASC' at line 1 [SELECT * FROM new_categories WHERE cat_left> AND cat_right< AND hidden<>1 AND cat_level=2 AND pid=7 ORDER BY cat_left ASC]