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 prod_id, weight, id asc' at line 1
query=select * from products_images where prod_id in () order by prod_id, weight, id asc