Invalid query:
Error Number: 1064
Error Message: 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 'ORDER by position LIMIT 1' at line 3
Whole query: SELECT imageid, position FROM tbl_product_images WHERE active = 1 AND productid = ORDER by position LIMIT 1