Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Re: [PEAR] DB_Object->insert() not returning ID
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

Report this thread to moderator Post Follow-up to this message
Old Post
Justin Patrin
11-30-04 01:56 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP Pear archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 07:12 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.