CodeIgniter Forums
get the user_id while inserting a new record to a table - 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: get the user_id while inserting a new record to a table (/showthread.php?tid=26964)



get the user_id while inserting a new record to a table - El Forum - 01-28-2010

[eluser]max123[/eluser]
I have a table called 'user'. Primary key is 'user_id' and it is an auto increment value. When I'm inserting a new user to the table, I want to get the user_id of that user. What is the sql query to do that

Thanx


get the user_id while inserting a new record to a table - El Forum - 01-28-2010

[eluser]n0xie[/eluser]
Code:
$this->db->insert_id()