By crislewis on
I wish to be able to create users using data from an external database.
I have managed to do the basics with user_save() but I can't work out how to include a value for an added field in the creation process. In this case the extra field is an employee number whch is used as a foroegn key back to the extrernal database.
In it's simpllest form I have:
$new_user = array(name=>joebloggs,
password=>easy,
mail=>joe@somewhere.com,
status=>1,
init=>joe@somewhere.com,
field_emp_no=>WMS0001);
$new_user= user_save(null,$new_user);
The creates the user but does not populate the added field. The object returned does have a field_emp_no attribute with a value of 'WMS0001' but this is not the same.
Thanks
Comments
Is it possible?
Anyone know if this is possible?
Just tried this
I have a user with four additional fields:
first, last, job title and organization
The following code has seemed to work for me: