title: mysql get list of all products ordered per customer in date range open cart
body: <p>I need to get a list of customers and what they ordered out of the database to send out weekly statements i want results to display like:</p>
  
  <p>customer firstname customer lastname<br/></p>
  
  <p>order_product name  order_product quantity <br/>
  order_product name  order_product quantity <br/>
  etc..<br/></p>
  
  <p>for each customer</p>
  
  <p>Here are my tables (left irrelevant columns out its default open cart if that helps):</p>
  
  <p><strong>Customer</strong></p>
  
  <p>firstname<br/>
  lastname<br/></p>
  
  <p><strong>order</strong></p>
  
  <p>customer_id <br/>
  order_id <br/>
  date_added<br/></p>
  
  <p><strong>order_products</strong></p>
  
  <p>order_id<br/>
  name<br/>
  quantity<br/></p>
  
  <p>got working thanks to Catcall - date range</p>
  
  <pre><code>    $sql =  "select c.customer_id, c.firstname, c.lastname, 
                         o.order_id, o.date_added, 
                         op.name, op.quantity
                  from `" . DB_PREFIX . "customer` c
                  inner join `" . DB_PREFIX . "order` o on o.customer_id = c.customer_id
                  inner join `" . DB_PREFIX . "order_product` op on o.order_id = op.order_id";
  </code></pre>
  
  <p>could someone please explain how to process array to the format previously requested php</p>