How to fetch the Id of the previously added record - 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: How to fetch the Id of the previously added record (/showthread.php?tid=25162) |
How to fetch the Id of the previously added record - El Forum - 12-03-2009 [eluser]skillfullbus[/eluser] Hi All, I am making a registration page wherein the data entered by the user would go into two different tables in the database. Now the second table has User Id as a foreign key to the User table (1st table) primary key which is auto increment. Now while adding data to the 2nd table I need the primary key of the user table (1st table). How do I get it? Pl help. Thanks ! How to fetch the Id of the previously added record - El Forum - 12-03-2009 [eluser]therealmaloy[/eluser] @skillfullbus check this thread. http://ellislab.com/forums/viewthread/63052/ How to fetch the Id of the previously added record - El Forum - 12-03-2009 [eluser]überfuzz[/eluser] You might even wanna store the id in a the session array. Then if the register id doesn't exists you redirect to the form(start). When the user is registered you unset the session('register_id'). How to fetch the Id of the previously added record - El Forum - 12-03-2009 [eluser]jedd[/eluser] You appear to be asking the second question that's asked (and answered) in the [url="/wiki/FAQ"]FAQ[/url]. Well done you. How to fetch the Id of the previously added record - El Forum - 12-04-2009 [eluser]skillfullbus[/eluser] Thanks Guys ! How to fetch the Id of the previously added record - El Forum - 12-04-2009 [eluser]überfuzz[/eluser] [quote author="jedd" date="1259874232"]You appear to be asking the second question that's asked (and answered) in the [url="/wiki/FAQ"]FAQ[/url]. Well done you.[/quote] Nice going, keep it up and soon it'll be nr1. |