How update user info using its UID in a custom module? We have a webform and when submitting this form we would like to update user info in the database regarding values of submitted Webform.

I already managed to get the submitted values from the webform in my custom module. But I don't know how to update the user info in the database because all user info are in separated tables.

I can run a few update queries for each value but it's not a logical way for me!

Any other suggestions?
You can equally use either user_save() or field_attach_update(). 

// Load the user's account.
global $user;
$account = user_load($user-&gt;uid);
$edit = $account-&gt;field_my_custom_field[LANGUAGE_NONE][0][value] = $new_value;
user_save($account, $edit);
// field_attach_update
$account-&gt;field_my_custom_field[LANGUAGE_NONE][0][value] = $new_value;
field_attach_update('user', $account);


The difference between using one function or the other is that user_save() will update all the user fields whereas field_attach_update() will update only the specified field.