title: DELETE FROM table WHERE IN() prepared statement deletes only the first value of array
body: <p>through ajax you get an array for $_POST.</p>
  
  <p>This is my code.</p>
  
  <pre><code>&lt;?php
  include 'connect.php';
  $deletethesestring = '';
  foreach ($_POST as $v)
  {
  
      $deletethesestring .= $v.',';
  
  }
  
  $deletethesestring  = rtrim($deletethesestring ,',');
  
  echo $deletethesestring;
  
  
  
  $deleteprizesqry = $pdo-&gt;prepare('DELETE FROM tbname where tbname_id IN(:deletethesestring);');
  $deleteprizesqry  -&gt; bindParam(':deletethesestring', $deletethesestring);
  
  $deleteprizesqry-&gt;execute();
  ?&gt;
  </code></pre>
  
  <p>if my array is for example [9,7,3,4,8,5]
  my code only deletes 9. and the rest still stay. I want it to delete every row whose id belongs in the array. how do i do this?</p>