SELECT id FROM parts WHERE p_id = AND show_cat = 1 AND type_ IN (0,2,3) AND l = '1' AND secure = '0' ORDER BY position_ 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 'AND show_cat = 1 AND type_ IN (0,2,3) AND l = '1' AND secure = '0' ORDER BY posi' at line 1