CodeIgniter Forums

Full Version: Return Row ID when inserting
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]domfosnz[/eluser]
Is there any way of accessing the Row Id of a freshly inserted record.

Once I have inserted a record I need to insert several child records in a separate table with the parent records ID.

Thanks

El Forum

[eluser]Jelmer[/eluser]
$this->db->insert_id()

Take a look at http://ellislab.com/codeigniter/user-gui...lpers.html for more helpfull functions.

El Forum

[eluser]domfosnz[/eluser]
Thanks Smile