How to avoid the error 'array expected string given' in db_query
You're using Drupal 6 syntax, you need to convert it to Drupal 7 syntax:

db_update('users')
  -&gt;fields(array('name' =&gt; $name, 'mail' =&gt; $mail))
  -&gt;condition('uid', $account-&gt;uid)
  -&gt;execute();


See the Database API docs for more details.