For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > October 2005 > Re: [PEAR] DB_Dataobject Insert Problem with getting id









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 Problem with getting id
Justin Patrin

2005-10-24, 6:57 pm

On 10/24/05, Sebastian Ganschow <sebastian@ganschow.net> wrote:
>
> Justin Patrin schrieb:
>
field[color=darkred]
> Hi,
>
> but i thought, if I set ignore_sequence_keys to ALL, Dataobject will use
> the native support
> for getting the id of the last inserted element.
>
> The documentation of this configuration option says:
> " If you do not want to use pear's nextval(), for automatically filling
> in sequences,
> this can disable it for "ALL", or a list of tables "person,cart,group""
>
> And the phpDoc for method insert() says:
>
> "*Return:* false on failure, int when auto increment or sequence used,
> otherwise true on success"
>
> So I don't want to use sequence keys, but the auto increment.
> If this behavior is correct, how can I use auto increment.
>


If you're using mysql you don't have to do anything. It will work
without any options set. If you're using another DB try it. If it
doesn't work you probably need to override sequenceKey() for your DOs
and return the correct values.

--
Justin Patrin
Sponsored Links







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

Copyright 2008 codecomments.com