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 ) and c.status=1 and p.status=1 group by c.lft order by c.lft asc' at line 1