title: Codeigniter - Combining Three tables into correct view format
body: <p>Completely confused on how to achieve something - I have three tables;</p>
  
  <ul>
  <li>Orders</li>
  <li>Items</li>
  <li>Products</li>
  </ul>
  
  <p>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.</p>
  
  <p>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...</p>
  
  <p><strong>ORDERS</strong></p>
  
  <p><strong>ORDER NUMBER 1</strong></p>
  
  <ul>
  <li>Example order item</li>
  <li>Second example order item</li>
  <li>Third example order item</li>
  </ul>
  
  <p><strong>ORDER NUMBER 2</strong></p>
  
  <ul>
  <li>Example order item</li>
  <li>Second example order item</li>
  <li>Third example order item</li>
  </ul>
  
  <p><strong>ORDER NUMBER 3</strong></p>
  
  <ul>
  <li>Example order item</li>
  <li>Second example order item</li>
  <li>Third example order item</li>
  </ul>
  
  <p>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.</p>
  
  <p>Does anybody know a good way of doing this? Many thanks in advance.</p>