You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '%7C402 AND properties.property_value='%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF...' at line 3SELECT goods.id FROM decorka_catalog_good AS goods LEFT JOIN decorka_catalog_good_property AS properties ON goods.id=properties.good_id WHERE goods.category_id=177 AND ((properties.property_id=%7C402 AND properties.property_value='%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD%EF%BF%BD')) ;