Hello, can anyone please help me on my problem.
During registration, I assign members to a random secondary usergroup. I achieved it doing this code:
PHP Code:
$membergroupidsrandom = rand(11,14);
$userdata->set('membergroupids', $membergroupidsrandom);
Now, I added a hidden custom profile field, and I want to insert the same value. the field is numbered 12 in the database.
will this work?
PHP Code:
$userdata->set('field12', $membergroupidsrandom);
I know my first set of codes, adding to membergroup will work, but I don't know about the second since field12 isnt in the users table, its on its own table.
can anyone help me?
UPDATE: I believe I have it. Can someone pleaes tell me if its right.
$userfields = array('field12' => "$membergroupidsrandom");
$userdata->set_userfields($userfields, true, 'admin');