title: MySQL bulk query update in a single query using multiple criterias
body: <p>This looks like a common question among many but I am yet to find a solution that helps.</p>
  
  <p>I have been able to find a bulk insert query that requires only a single query but for update, the structure of the query is a fair bit different.</p>
  
  <p>Is it possible to create an update query that works with many different lines.</p>
  
  <p>I am already able to create a query that runs the correct number of times and updates the rows correctly but it runs multiple times.</p>
  
  <p>This creates quite a stack of queries which as everyone knows, can take alot of processing.</p>
  
  <p>Here is the bulk insert query I have found:</p>
  
  <pre><code>$sql = array();  
  foreach( $data as $row ) {     
      $sql[] = '("'.mysql_real_escape_string($row['text']).'", '.$row['category_id'].')'; 
      } 
  mysql_query('INSERT INTO table (text, category) VALUES '.implode(',', $sql)); 
  </code></pre>