title: Selecting from database where id in given array
body: <p>I'm trying to select elements from a table in a mysql database where the id of a row is in the given array.</p>
  
  <p>This returns values:</p>
  
  <pre><code>&lt;?php
       $ids = '1,2,3,4';
       $DBH = ....
       $getID = $DBH-&gt;prepare("SELECT * FROM t1 WHERE id IN ($ids)");
       $getID-&gt;execute();
  ?&gt;
  </code></pre>
  
  <p>This returns nothing: </p>
  
  <pre><code>&lt;?php
       $ids = '1,2,3,4';
       $DBH = ....
       $getID = $DBH-&gt;prepare("SELECT * FROM t1 WHERE id IN (:ids)");
       $getID-&gt;execute(array(':ids'=&gt;$ids));
  ?&gt;
  </code></pre>
  
  <p>I can't understand what is wrong with that code.  </p>