mysql_insert_id? - 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: mysql_insert_id? (/showthread.php?tid=23178) |
mysql_insert_id? - El Forum - 10-02-2009 [eluser]duffy0[/eluser] Is there any native way in the codeigniter database abstraction to do something like mysql_insert_id? I am inserting a post from a user into a "posts" table. I then want to insert the ID generated for this post into another table called "index_queue." I have a perl script that will run every 10 minutes or so and will create an index of all the posts whose ID's are in "index_queue." I just need to know how I can get ID's of the posts when I insert them to the database. Here is my code. This is an API call so I am using XML_RPCS, but I dont thing that complicates anything. Code: function new_post($request) { mysql_insert_id? - El Forum - 10-02-2009 [eluser]jedd[/eluser] [quote author="duffy0" date="1254543570"] I just need to know how I can get ID's of the posts when I insert them to the database. [/quote] Yeah, it's the kind of thing you'd expect would [url="http://codeigniter.com/wiki/FAQ/"]be in the FAQ[/url], isn't it? mysql_insert_id? - El Forum - 10-02-2009 [eluser]duffy0[/eluser] Wow.. -slaps forehead- Thanks. mysql_insert_id? - El Forum - 11-16-2009 [eluser]tokyotech[/eluser] Can I request that this be added to the manual instead of only in the FAQ? Thanks. mysql_insert_id? - El Forum - 11-16-2009 [eluser]Aken[/eluser] It is in the manual... http://ellislab.com/codeigniter/user-guide/database/helpers.html If even says that it is in the manual in the FAQ entry, lol. mysql_insert_id? - El Forum - 11-16-2009 [eluser]jedd[/eluser] These computer things are mighty confusing, eh? mysql_insert_id? - El Forum - 11-16-2009 [eluser]mjsilva[/eluser] It was so much easier when we have file cabinets with letters separating the files |