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 ' p.cat_id) and p.active = '1' and c.catStatus = '1' and c.catId = '' order by p.' at line 1