title: PHP PDO and IN clause
body: <p>I have a statement being used with PDO which is as follows:</p>
  
  <pre><code>$stmt = _DB::init()-&gt;prepare("SELECT a.*
                                FROM tax_class a
                                INNER JOIN products_to_tax_class pa 
                                ON a.tid = pa.tid
                                WHERE pa.pid IN (1,2)
                               ");
  </code></pre>
  
  <p>Now the statement gets executed, however it only grabs results for <code>pa.pid = 2</code>, or the last value of the ones given. Would anyone be able to explain this for me? I was expecting an array of results from both <code>id's 1 and 2</code> however this only outputs <code>Array ( [tid] =&gt; 2 [rate] =&gt; 7.30 [name] =&gt; Something )</code></p>
  
  <pre><code>if ($stmt-&gt;execute())
            return $stmt-&gt;fetch(PDO::FETCH_ASSOC);
  </code></pre>
  
  <p>Thanks</p>