1064 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 is_deleted = 0 ORDER BY is_main DESC LIMIT 1' at line 1
in:
[SELECT name FROM max_products_images WHERE id_products = and is_deleted = 0 ORDER BY is_main DESC LIMIT 1]