I want to be able to list all items that have been purchased in every order for all orders where an item within that order is a specific item.
Eg: I want to be able to do a search for all orders where tomato ketchup has been ordered and list all the products in these orders.
I want to be able to say, therefore, for all customers that purchased tomato ketchup, what other products accompanied that item.
Its similar to what you would expect to see in any cyber market place where "others also bought..."
The database I am using has a table with products and an order ID. I imagine the simplest way is to write a PHP script to perform 2 queries, one to return all orders containing the item in question and another to list all items for each of the order IDs. But I had hoped there was a "clever" query that could replace that.
My ultimate goal would be to search for all orders where a list of items exist. The idea is to try and whittle down the results to only show those where the specified combination of products has been found.