Return Row ID when inserting - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Return Row ID when inserting (/showthread.php?tid=12375) |
Return Row ID when inserting - El Forum - 10-16-2008 [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 Return Row ID when inserting - El Forum - 10-16-2008 [eluser]Jelmer[/eluser] $this->db->insert_id() Take a look at http://ellislab.com/codeigniter/user-guide/database/helpers.html for more helpfull functions. Return Row ID when inserting - El Forum - 10-16-2008 [eluser]domfosnz[/eluser] Thanks |