title: Update multiple rows with multiple 'where' clauses for each individual row
body: <p>I am trying to update my table like this:</p>
  
  <pre><code>Update MyTable 
  SET value     = 1 
  WHERE game_id = 1,
        x       =-4,
        y       = 8
  
  SET value     = 2 
  WHERE game_id = 1,
        x       =-3,
        y       = 7
  
  SET value     = 3 
  WHERE game_id = 2,
        x       = 5,
        y       = 2
  </code></pre>
  
  <p>I can do a <code>foreach()</code> but that will send over 50 separate Queries which is very slow.
  That's why I want it to be combined into 1 big Query.</p>
  
  <p>( I do use an <strong>id</strong> for each row but the combination of <strong>game_id</strong>, <strong>x</strong> and <strong>y</strong> is what I use to Identify the row I need. )</p>
  
  <p>The update_batch() function from codeIgniter described here:
  <a href="https://stackoverflow.com/questions/6264955/update-batch-with-codeigniter">Update batch with CodeIgniter</a>
  was helpful and almost perfect but it only allows for 1 single where clause, you cannot (as far as I understood and tried) enter an array with multiple where clauses.</p>
  
  <p>I've also checked out this question:
  <a href="https://stackoverflow.com/questions/9368505/mysql-update-set-on-the-same-column-but-with-multiple-where-clauses">MYSQL UPDATE SET on the Same Column but with multiple WHERE Clauses</a>
  But it only allows for multiple row updates containing only a single different WHERE clause and I need multiple WHERE clauses! :)</p>
  
  <p>Anwsers can be in simple SQL or with the use of php (and CodeIgniter) or in a different way. I'd this problem to be solved in any possible way ;)</p>
  
  <p>I can really use the advice/help! =D</p>