Drupal: Storing data in the user profile
| drupalIf you want to store data in the user profile, here’s an example of a quick and dirty way to do it:
global $user;
if ($user) {
$array = array('fieldname' => 'value_to_save');
user_save($user, $array);
}
Then access it with $user->fieldname. For more configurability, check out the Profile module.
1 comment
TechNikh
2011-12-02T03:28:40ZThis works in one way but views module doesn't show the profile values stored in this manner. I guess this is because the data is stored in serialized manner an not in database profile table