How to get the pk of an inserted record in another table during plug_in php

Status
Not open for further replies.

bontemuis

Member
I would really appreciate some advice. I'm planning to contruct this setup of tables:

Registration (with juser; I create for each user joined entries in the following tables
Profile and some more tables (let's say 7)

Ideally I would like to know the profile___id (I tried to find it in a php plug_in onAfterProcess, but no luck) to store in the other tables to create the joines.
So my first question would be: can I and if so, how do I retrieve the profile___id?

Would you recommend to use the (Joomla) user_id instead as the pk of the Profile table? That would make things a lot easier, I think... Or is using another pk instead of the default pk not advisable?
 
You already made a suggestion yourself to use Joomla user id which is unique. So why not to use this.
 
Thanks juuser,

I thought that I read somewhere in the Wiki to hold back using anything different than the default pk. But, in the search for this, I found (what is exectly what you are corfirm:

"Primary Key
This refers to the column heading in your database table that is the main reference point for the rest of the information in your database table, for example a user's ID may be the primary key for a database table collecting information specifically connected to users' information."

So, now knowing this, makes my 'Fabrik life' even easier!
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Staff online

Members online

Back
Top