title: MySQL JOIN from 2 tables with same ID using PHP
body: <p>I got a table like:</p>
  
  <p><strong>product</strong>                      </p>
  
  <pre><code>id | product_id             
  1     55                     
  2     56                    
  3     57                    
  </code></pre>
  
  <p><strong>product_options</strong></p>
  
  <pre><code>id | product_id | options_value
  1       55           88
  2       55           87
  3       55           89
  </code></pre>
  
  <p>...                          ...</p>
  
  <p>I want to select all <code>option_values</code> from <strong>product_options</strong> where <code>product_id</code> from <strong>product</strong> is same with <code>product_id</code> from <strong>product_options</strong>.</p>
  
  <p>After I select all fields from product I use this:</p>
  
  <pre><code>$sql .= " LEFT JOIN " . DB_PREFIX . "product_option_value ovi ON (ovi.product_id=p.product_id)";
  
  if(...){
  $sql .= " AND  ovi.option_value_id='$value'";
  }
  </code></pre>
  
  <p>The problem is: If I only got one <code>options_value</code>, it's fine.
  but when I have 2 or more <code>options_values</code> the result is 0.</p>
  
  <p>i want to select all <code>options_value</code> from <strong>product_options</strong> for all <code>product_id</code> from <strong>product_options</strong></p>
  
  <p>PS. Sorry for my english and explication</p>