title: Join three tables in one sql query
body: <p>I have a query with two tables and I need to JOIN one more to it so I can get the product model corresponding to the order.</p>
  
  <p>What I have so far is </p>
  
  <pre><code>$sql = "SELECT 
    o.order_id, 
    o.name, 
    o.value, 
    GROUP_CONCAT(o.order_id,  o.name, o.value SEPARATOR ',') AS Options 
  FROM `order_option` AS o 
  LEFT JOIN `order` AS oo on o.order_id = oo.order_id
  where oo.order_status_id = 2 
  group by o.order_id";
  
  mysql_query("SET NAMES 'utf8'");
  $result = mysql_query($sql); 
  while($row = mysql_fetch_assoc($result))
   {
  $options=$row['Options'];
  print "$options";
  
      PRINT "&lt;br&gt;-------------------&lt;br&gt;";
  } 
  </code></pre>
  
  <p>Now, I have a third table that contains the product model for each order. The table is called "order_product", it has two fields "order_id" and "model" (one record per order).</p>
  
  <p>What I have now as a result now is</p>
  
  <p>ID, option1: Valude, option2: Value</p>
  
  <p>What I want to accomplish is </p>
  
  <p>ID, MODEL, option1: Valude, option2: Value</p>
  
  <p>Where the model should come from the third table "order_product"</p>
  
  <p>Any suggestions are highly appreciated.
  Thanks</p>