For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > January 2005 > Re: [PEAR] Db_dataobject insert()









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [PEAR] Db_dataobject insert()
Justin Patrin

2005-01-26, 3:57 pm

On Wed, 26 Jan 2005 16:33:04 +0100, mishal@centrum.cz <mishal@centrum.cz> wrote:
> Hello,
>
> i have problems with db_dataobject insert() method.
> it should return the ID of the inserted element.
> i found in mailing list archive, that this problem was reported
> before.
> http://marc.theaimsgroup.com/?l=pea...86296714930&w=2
>
> i have installed db_dataobject version 1.7.2.,
> use mysql 4.0.2.
>
> is this problem fixed?
>


The insert method does not return the ID AFAIK. It does, however, set
it in the DO. So somehting like:

$do->insert();
echo $do->id;

should work. It's what I use.

--
Justin Patrin
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com