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 'AS C ON P.category_id = C.category_id LEFT JOIN property_types AS L ON C.propert' at line 1