Re: Db_dataobject insert()
| From: | mishal at centrum dot cz | Date: | Thu, 27 Jan 2005 21:43:25 +0000 |
| Subject: | Re: Db_dataobject insert() | ||
| References: | 1 2 3 4 5 6 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-17228@lists.php.net to get a copy of this message | ||
JP> I'm not sure what the issue is, then. Please check the mailing list
JP> archives as I know others have had this problem.
I found that this problem have had users before.
In this:
http://marc.theaimsgroup.com/?l=pear-general&m=110054613417769&w=2
thread is said that db_dataobject insert method returns true, false or
0.
I tried to downgrade my db_dataobject installation to version 1.4
and now it *WORKS*.
$do->insert() now returns last_insert_id.
i found that in newer versions of DO insert() returns true.
>>
>>
>> >>
>> >> what's wrong?
>> >>
>> >> Thank you
>> >>
>> >> Michi
>> >>
>> >> JP> On Wed, 26 Jan 2005 16:33:04 +0100, mishal@centrum.cz
>> >> JP> <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=pear-general&m=110186296714930&w=2
>> >> >>
>> >> >> i have installed db_dataobject version 1.7.2.,
>> >> >> use mysql 4.0.2.
>> >> >>
>> >> >> is this problem fixed?
>> >> >>
>> >>
>> >> JP> The insert method does not return the ID AFAIK. It does, however, set
>> >> JP> it in the DO. So somehting like:
>> >>
>> >> $do->>insert();
>> >> echo $do->>id;
>> >>
>> >> JP> should work. It's what I use.
>> >>
>> >> JP> --
>> >> JP> Justin Patrin
>> >>
JP> --
JP> Justin Patrin
--
Best regards,
mishal mailto:mishal@centrum.cz