db_update Query Issue I am using ubercart guest checkout module. I am able to submit  the order as guest etc works fine. 

After Reviewing the order and submitting it throws me this error 

Recoverable fatal error: Argument 2 passed to db_query() must be an array,
string given, called in
/var/www/html/dev.demo.net/sites/all/modules/ubercart_guest_checkout/uc_guest_checkout.module
on line 263 and defined in db_query() (line 2342 of
/var/www/html/dev.demo.net/includes/database/database.inc).


This is the query which is causing that issue  

db_query('UPDATE {users} SET name = "%s", mail = "%s" WHERE uid = %d', $name, $mail, $account-&gt;uid);


I tried to change this query like this

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


still no luck, it throws me same above specified error.  

How can i resolve the query of above one in order to avoid the error. Any suggestions w.r.t query will be nice.Thanks in advance.
Drupal 7 doesn't use %placeholder style query placeholders. Furthermore, there's an error passing a list of strings to db_query instead of an array.

Your query would be

db_query('UPDATE {users} SET name = :name, mail = :mail WHERE uid = :uid',
           array(':name' =&gt; $name, ':mail' =&gt; $mail, ':uid' =&gt; $account-&gt;uid));


However, you should probably use db_update for update queries, in which case it would indeed be:

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


You error is occurring because the initial db_query accepts an array of parameters in D7.

More info: 
https://api.drupal.org/api/drupal/includes%21database%21database.inc/group/database/7