2

first sorry if its a stupid question but im lost a bit.

So when i use ion auth register function, and the register is ok, inserts the user data in the users table, and inserts the users id in to the groups table too.

Im a bit lost at this part, i would like to insert the user id in to the user profile table, and user settings table, after the registration is complete.

And i dont really know which function to modify. I was looking at the model and library searching for how the group is added into the database but couldnt really find any hint in the code.

So could someone please help me out on this? Pointing to a tutorial maybe or just giving me a hint where to start the modify

Thank you

1 Answer 1

4

In models/ion_auth_model.php at line 733 starts the register function.

You can extend somewhere on line 793, after the line that gets the id of the user $id = $this->db->insert_id(); just add your custom data you wish to insert:

$mdata = array(
    'user_id' => $id,
    // ... your other data here
);
$this->db->insert('my_table', $mdata);
Sign up to request clarification or add additional context in comments.

7 Comments

i feel a bit stupid now that line didnt caught my attention, thanks for your help and for spearing time in my question
No problem, I remember myself trying to find something there and failing at first. The file is structured strangely if structured at all.
one last question, this extedns the user id right? id = $this->db->insert_id(); because i added a query, inserts everything but the user id is always 0
Are you sure you are doing it after line $id = $this->db->insert_id(); (line 792) ?
so sorry my bad, added under it and it works, so sorry, and sorry form bugging you
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.