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-27, 4:00 pm

On Thu, 27 Jan 2005 20:01:49 +0100, mishal@centrum.cz <mishal@centrum.cz> wrote:
> Hello Justin,
>
> thank you for your reply.
> I tried to get the id as you adviced me, but still can't get the last
> insert id. :-(
> i allways get NULL.
>
> here's the dump of the dataobject:
>

[snip]

Did you set up that field as the primary key? Is it an auto_increment
value? What's this table's entry in your db.ini file look like? (both
the table and its keys)

>
> what's wrong?
>
> Thank you
>
> Michi
>
> JP> On Wed, 26 Jan 2005 16:33:04 +0100, mishal@centrum.cz <mishal@centrum.cz> wrote:
>
> 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
>


--
Justin Patrin
Sponsored Links







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

Copyright 2008 codecomments.com