[Drupal] How to update an existing user's profile data programmatically using user_save() in drupal?

| | 1 min read

User profile plays a significant role in identifying and categorizing users based on their characteristics or preferences, planning specific features, influences navigation, and the way interaction happens in the system.Today, almost everyone creates a profile in jobsites or social media websites. Frequent updation of a user's profile data is extremely important. In this article, we will see how can we update an existing user's profile data. Below is the code snippet that is used to update user's profile data.

  
    'Annu'
   );

   //Saving existing user
   
   user_save(
     (object) array('uid' => $existinguser->uid), 
       $edit,
       'Personal Information' //category
   );
   ?>