I used user_save to update the field. However, whenever I run this function and I log out and try to log back the password doesn't work anymore.I think it cause a change in the password. can anyone help me to get the actual password back?
$existingUser1 = user_load($uid1);
$existingUser1->field_group_id[LANGUAGE_NONE][0]['value'] = $g_id;
user_save((object) array('uid' => $existingUser1->uid), (array) $existingUser1);