I'm trying add a new user to drupal 7, here is my code:
$values = array('name' => $name, 'pass' => $password, 'mail' => $email, 'status'=>1);
$newUser = user_save('', $values);
But i also have the new field field_foobar, if i add it to the values array drupal does nothing with it. What is the correct drupal way of adding these values to my user object so that drupal saves them when i call the user_save function?
I also saw that the fields are stored in the same type of table that stores custom fields of nodes. Also can't get this done, but i guess these 2 problems can have the same solution.
Thanks, Jonathan!