Code Comments
Programming Forum and web based access to our favorite programming groups.On Mon, 29 Nov 2004 15:19:15 -0800, Ken Restivo <ken@restivo.org> wrote: > On Mon, Nov 15, 2004 at 10:46:12AM -0800, Justin Patrin wrote: > > Thanks. The API docs also have the wrong information in the main body (abo ut returning the last inserted ID), but with a note that says "mysql-specifi c? fixme". My fault for missing that, I guess. It does describe the return v alue correctly. > > I read somewhere that the inserted ID gets inserted into the object after the ->insert(). Is that a reliable, safe way to get the last inserted ID? > > I think what I'm saying is, I can't believe that I have to write a utility functio n (and then subclass DBDO or copy/paste it) to get the last inserted ID. It seems li ke a very common thing and somewhere in the DBDO docs I must have overlooked the "of fic ially-approved" way to do it. > When I use DB_DataObject (please call it that, not DB_Object) the id is in the object after the insert() call. Of course, I'm using mysql. I have no idea about other RDBMS. -- Justin Patrin
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.