Completely confused on how to achieve something - I have three tables;
- Orders
- Items
- Products
The orders table contains the details of an order, the items table contains a product id number and an order id number, and the products table contains all the product details.
What I'm trying to do is have a "My orders" page, where you can view all your past orders, and what i would like is to be able to have the following structure...
ORDERS
ORDER NUMBER 1
- Example order item
- Second example order item
- Third example order item
ORDER NUMBER 2
- Example order item
- Second example order item
- Third example order item
ORDER NUMBER 3
- Example order item
- Second example order item
- Third example order item
Now i can easily list all the orders, and i can list all the items on a particular order, but I'm lost on how to merge these three tables in a way i can list them in the above format, i assume i can JOIN on all three, but i can't get them to output in anywhere near the correct way.
Does anybody know a good way of doing this? Many thanks in advance.
See Question&Answers more detail:os