I've added three fields in user form.

  1. User code
  2. User name
  3. User ID.

I want to add this field data into the database. My question is, in which hook, i should write the logic of manipulating and saving data.

  • How did you add fields to user form? If you used admin interface (admin/config/people/accounts/fields) all information will be automatically stored in the database – Andrew Jul 16 '15 at 13:01
  • Ya. absolutely correct. But it can be done by new user at time of registration. What i want is, Those accounts which is already their since long, I want to update that one. – Viraj Jul 17 '15 at 3:10
  • I found solution using user_import module. It worked very well. – Viraj Jul 18 '15 at 17:55

Hook implementation depends on when you want to manipulate the user account data.

If you need to update existing users with new data you need your own custom function that makes user of user_load() (to load a user object) & user_save() (to save your manipulated user object with new data).

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.