Re: DB_Dataobject Insert Problem with getting id
| From: | Justin Patrin | Date: | Tue, 25 Oct 2005 16:23:00 +0000 |
| Subject: | Re: DB_Dataobject Insert Problem with getting id | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-21635@lists.php.net to get a copy of this message | ||
On 10/25/05, Sebastian Ganschow <s.ganschow@buelow-masiak.de> wrote:
>
> Sebastian Ganschow schrieb:
>
> > Justin Patrin wrote:
> >
> >> 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.
> >
> >
> >
> > Hi,
> >
> > I removed the option ignore_sequence_keys = ALL, but now dataobject
> > has created new tables and is using sequence keys.
> >
> > We're using MySQL 4.1.11 and the tables, where we want to get this
> > ids, have the id fields set to auto increment.
> >
> > I thought the documentation meant, that dataobject will allways use
> > sequence keys, but if your tell it not to use seq-keys, it will
> > use the native auto increment support.
> > It looks like I have to override sequenceKey().
> >
> > Sebastian
> >
>
> Okay it seems that this error doesn't appear regularily. In an other
> project
> I romoved ignore_sequence_keys = ALL and Dataobject is using the native
> support. I think we have to check the structure of the tables, where it
> doesn't
> work..
>
Do you have your auto-inc columns set as the primary key? DB_DO should
use mysql's auto-inc keys automatically....
--
Justin Patrin