title: Get the number of rows affected by multiple delete
body: <p>How can I get a count of the number of affected rows when I'm deleting multiple rows in PDO?  This is the technique I'm using to delete multiple rows:</p>
  
  <pre><code>$selected = $_POST['checkbox'];
      $N = count($selected);
      for ($i = 0; $i &lt; $N; $i++) {
          $result = $dbh-&gt;prepare('DELETE FROM users WHERE id= :id');
          $result-&gt;bindParam(':id', $selected[$i], PDO::PARAM_INT);
          $result-&gt;execute();
      }
  </code></pre>
  
  <p>I tried this, but it always returned 1:</p>
  
  <pre><code>$deleted = $result-&gt;rowCount();
      if ($deleted) {
          echo $deleted.' was deleted.';
      }
  </code></pre>