title: match multiple rows on same table MySQL
body: <p>I'm making a faceted navigation with PHP and MySQL. I ran into a problem where I want to get the products with the specific filter.</p>
  
  <p>Example structure and data here: <a href="http://sqlfiddle.com/#!9/80065/4" rel="nofollow">http://sqlfiddle.com/#!9/80065/4</a></p>
  
  <p>Using the query from sqlfiddle I would get the results for one filter just fine.</p>
  
  <p>For 2 filters the "query" that "would" work would be something like:</p>
  
  <pre><code>SELECT * FROM `attributes` WHERE ( `attribute_id` = '49' AND `text` = 'LED' ) AND ( `attribute_id` = '358' AND `text` = '1920x1080 (FullHD)' )
  </code></pre>
  
  <p>And of course this does not work.</p>
  
  <p>The final query needs to give me the products ids. From the example it would be: 37743
  37697</p>
  
  <p>There are around 200,000 rows in the table.</p>
  
  <p>I don't think JOIN would be a solution because it takes a lot of time and this will be used on a website faceted navigation.</p>
  
  <p>Matching one row is not a problem but when I try to match two rows from the same table I can't get it to work.</p>
  
  <p><strong>The filter needs to be usable with more than 2 WHERE's, the search for 2 attributes is just a example, I will need more than that</strong>.</p>
  
  <p>The returned rows need to contain the product_id which match my filter for 2 or more attributes.</p>
  
  <p>Thanks for the help!</p>