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 c.rgt< GROUP BY c.catid' at line 6
SELECT c.category FROM yew.product_manufacturers m LEFT JOIN yew.products p USING(manufacturerid) LEFT JOIN yew.products_bycat bc USING(productid) LEFT JOIN yew.product_categories c USING(catid) WHERE m.filename="hartmann" AND p.discontinued=0 AND category!="" AND c.lft> AND c.rgt< GROUP BY c.catid