title: How to display rows with data same of the displayed row
body: <p>I have a table similar to:
  product_id - code - name - img - ...</p>
  
  <p>I've made a page to display all the products.
  Once you click on one, you go to that product's detail page.
      "></p>
  
  <p>In the first part of the details page there are all the data referring to the selected code
  and this is working right.</p>
  
  <pre><code>$var1_getProduct = "unavailable";
  if (isset($_GET['code'])) {
  $var1_getProduct = $_GET['code'];
  }
  ...
  $query_getProduct = sprintf("SELECT * FROM product WHERE product.code = %s", GetSQLValueString($var1_getProduct, "text"));
  </code></pre>
  
  <p>In the bottom of the page I'd like to display all the other products that have same name.
  I made similar tril, but no one seems to work and I don't understand how should I deal with this...</p>
  
  <p>Should I made a different query? I tried but didn't work...
      $query_getProducts = "SELECT * FROM product WHERE product.code = getProducts['code']"</p>
  
  <p>Or should I try to Join the table on itself, like if are 2 different table ? Also this didn't work...
      $query_getProducts = "SELECT  t2.name FROM    <code>product</code> t1 JOIN    <code>product</code> t2 ON (t2.name = t1.name) WHERE   t1.name = '$name' AND t1.name != '0'";</p>
  
  <p>The problem being I don't know how to achieve the result I need, I mean the way to reach (and also the code..., but that will be a different problem!)</p>
  
  <p>EDIT
  I didn't mention the solution i found that is more near to what i need, that is:</p>
  
  <pre><code>SELECT product.name
  FROM product 
  INNER JOIN ( 
  SELECT product.name
  FROM product
  WHERE product.code = var1 
  ) pname ON pname.name = product.name
  </code></pre>
  
  <p>the problem with this, is that it show all the products with that name, including the active one. So I'm also not able to put an IF 'product with same name exist' Echo the parent DIV...</p>