CodeIgniter Forums
Return back data that was just inserted into DB - 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 back data that was just inserted into DB (/showthread.php?tid=20463)



Return back data that was just inserted into DB - El Forum - 07-10-2009

[eluser]Unknown[/eluser]
I'm inserting data into a DB with $this->db->insert(), and I need to return back the 'id' that is created using auto_increment for use in my next action, any easy way to do this?


Return back data that was just inserted into DB - El Forum - 07-10-2009

[eluser]Chad Fulton[/eluser]
How about $this->db->insert_id(); ? Tongue


Return back data that was just inserted into DB - El Forum - 07-10-2009

[eluser]Unknown[/eluser]
How in the world did I miss that? I looked at the exact page. It's just been one of those days.