title: PHP, MySQL - Get rows matching all items from an array
body: <p>I have a problem with a query. I searched here and on Google but can't find the solution. I can do it with a loop or an alternate solution, but this would mean time consuming (on page loading).... So I would like to know if there is a 'one query' solution.</p>
  
  <p>I have a table containing 4 columns:</p>
  
  <pre><code>id   class    day    hour
   1   9b3      1      3      
   2   9b4      1      3
   3   9b5      1      3
   4   9b3      1      5
   5   9b4      2      6
   6   9b5      2      6
   7   9b4      4      7
   8   9b3      3      6
   9   9b4      3      6
   10  9b5      3      6
  </code></pre>
  
  <p>What I need is to recover the day and hour matching all three classes 9b3, 9b4, 9b5 at the same day and hour.</p>
  
  <p>In the example above, the result should be:</p>
  
  <pre><code>day   hour
  1      3
  3      6
  </code></pre>