Welcome Guest, Not a member yet? Register   Sign In
Selecting the record I've just inserted?
#1

[eluser]KeyStroke[/eluser]
I'm using active records in CI to insert records.

In one table, the ID is a primary key set to auto-increment, so I just leave it empty while inserting and the database will assign an ID number for it.

However, I have to use that same ID to insert a record into a related table right after that.

My question is, how do I select the ID of the record I've just inserted?


Thanks in advance!


Messages In This Thread
Selecting the record I've just inserted? - by El Forum - 04-14-2008, 03:54 AM
Selecting the record I've just inserted? - by El Forum - 04-14-2008, 04:06 AM
Selecting the record I've just inserted? - by El Forum - 04-14-2008, 04:14 AM
Selecting the record I've just inserted? - by El Forum - 04-14-2008, 06:22 AM
Selecting the record I've just inserted? - by El Forum - 06-18-2008, 01:57 AM
Selecting the record I've just inserted? - by El Forum - 06-18-2008, 02:12 AM
Selecting the record I've just inserted? - by El Forum - 06-18-2008, 02:14 AM



Theme © iAndrew 2016 - Forum software by © MyBB