select p.*,pt.class from product_photo p LEFT JOIN product_photo_type pt ON p.photo_type = LEFT JOIN product_supplier ps ON p.company_id = WHERE = "1" and p.company_id= and<>{{}} order by rand()
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 'and<>{{}} order by rand()' at line 1