title: AES_ENCRYPT MySQL Update Query
body: <p>I hope you can help. I am trying to use the AES_ENCRYPT on my update query but I am unable to get it to work.</p>
  
  <p>I am trying to encrypt the first_name variable but when I run the query it refuses to update the field. When I remove the AES_ENCRYPT method from the update query it works absolutely fine.</p>
  
  <p>My current code looks as follows:</p>
  
  <pre><code>if(!define('SALT')) define('SALT','4a7s3n3j93n98lk');
  
  $sql = "UPDATE cases 
      SET first_name=?, 
          last_name=?
      WHERE cases_id=?";
  
  $query = $db-&gt;prepare($sql);
  $query-&gt;execute(array(
      AES_ENCRYPT('$first_name','".SALT."'), 
      $last_name,
     $id));
  $db = null;
  </code></pre>