I have an array with product ids. The product ids are already sorted by relevance.
Now I want to get the products name, description, image and all the other information from the products database.
What I did was create a sql query with a that looks something like this:
SELECT name, description, image_url FROM products WHERE products_id = 00004 OR products_id = 00233 OR products_id 00002
However the result is in no particular order. The question is: How do I get those results in the exact order of my array? Or do I have to make a seperate query for all products_id:
SELECT name, description, image_url FROM products WHERE products_id = 00004
SELECT name, description, image_url FROM products WHERE products_id = 00233
SELECT name, description, image_url FROM products WHERE products_id = 00002