title: Using a PDO to replace characters in a field
body: <p>I have table of around 9,000 rows in which I need to go about searching one specific column and replacing specific characters with their appropriate replacement. For this I have an associative array of values. Below is my code which will give a better idea of what I'm trying to achieve. I am trying to do this as efficiently as possible and with as little queries as I can. Any help would be appreciated.</p>
  
  <pre><code>try {
    $DBH = new PDO("mysql:host=$host;dbname=$dbname", $user, $pass);
  }
  catch(PDOException $e) {
  
      die($e-&gt;getMessage());
  
  }
  
  $diacritics = array(
      'Š'=&gt;'S', 'š'=&gt;'s', 'Ð'=&gt;'Dj', 'Ž'=&gt;'Z', 'ž'=&gt;'z', 'C'=&gt;'C', 'c'=&gt;'c', 'C'=&gt;'C', 'c'=&gt;'c',
      'À'=&gt;'A', 'Á'=&gt;'A', 'Â'=&gt;'A', 'Ã'=&gt;'A', 'Ä'=&gt;'A', 'Å'=&gt;'A', 'Æ'=&gt;'A', 'Ç'=&gt;'C', 'È'=&gt;'E', 'É'=&gt;'E',
      'Ê'=&gt;'E', 'Ë'=&gt;'E', 'Ì'=&gt;'I', 'Í'=&gt;'I', 'Î'=&gt;'I', 'Ï'=&gt;'I', 'Ñ'=&gt;'N', 'Ò'=&gt;'O', 'Ó'=&gt;'O', 'Ô'=&gt;'O',
      'Õ'=&gt;'O', 'Ö'=&gt;'O', 'Ø'=&gt;'O', 'Ù'=&gt;'U', 'Ú'=&gt;'U', 'Û'=&gt;'U', 'Ü'=&gt;'U', 'Ý'=&gt;'Y', 'Þ'=&gt;'B', 'ß'=&gt;'Ss',
      'à'=&gt;'a', 'á'=&gt;'a', 'â'=&gt;'a', 'ã'=&gt;'a', 'ä'=&gt;'a', 'å'=&gt;'a', 'æ'=&gt;'a', 'ç'=&gt;'c', 'è'=&gt;'e', 'é'=&gt;'e',
      'ê'=&gt;'e', 'ë'=&gt;'e', 'ì'=&gt;'i', 'í'=&gt;'i', 'î'=&gt;'i', 'ï'=&gt;'i', 'ð'=&gt;'o', 'ñ'=&gt;'n', 'ò'=&gt;'o', 'ó'=&gt;'o',
      'ô'=&gt;'o', 'õ'=&gt;'o', 'ö'=&gt;'o', 'ø'=&gt;'o', 'ù'=&gt;'u', 'ú'=&gt;'u', 'û'=&gt;'u', 'ý'=&gt;'y', 'ý'=&gt;'y', 'þ'=&gt;'b',
      'ÿ'=&gt;'y', 'R'=&gt;'R', 'r'=&gt;'r'
  );
  
  
  $dia_remove_STH = $DBH-&gt;prepare("UPDATE mytable SET title=?"); 
  //THE FOLLOWING LINE IS OBVIOUSLY NOT VALID BUT IS THE FUNCTIONALITY I'M LOOKING TO ACHIEVE
  $dia_remove_STH-&gt;execute(array(strtr(mytable.title, $diacritics));
  </code></pre>