title: Update multiple rows with one query
body: <p>How can I update hundreds of rows at once?</p>
  
  <p>Like:
  <code>UPDATE table SET a = ? WHERE b = ? AND c = 1</code></p>
  
  <p>but for many rows. The <code>?</code> parameters are arrays...</p>
  
  <p>I read <a href="https://stackoverflow.com/questions/2528181/update-multiple-rows-with-one-query">this answer</a> but it uses CASE and I don't think I can do that...</p>
  
  <hr>
  
  <p>Right now I have something like this:</p>
  
  <pre><code>foreach($values as $key =&gt; $value)
    $res = $pdo-&gt;prepare('UPDATE table SET a = ? WHERE b = ? AND c = 1');
    $res-&gt;execute(array($value, $key));
  }
  </code></pre>