Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Get last inserted id


Reply


2 Posts   1443 Views

Avatar
m-phil

Community Member, 37 Posts

3 July 2010 at 11:43pm

Edited: 04/07/2010 12:37am

Hey, is there a db function that gives me the last inserted id or better a query function that returns the new id directly?
I got a query excuted via DB::query('INSERT INTO...'); and need the id of the entry.
The return param doesn't give it. I know that I can get it with a new select query but, it isn't the best way I think.
Thx

Avatar
UncleCheese

Forum Moderator, 4096 Posts

4 July 2010 at 2:18am

DB::getGeneratedID($table);