FW: [PEAR] dataobject : problem with insert function
| From: | Denis Gerasimov | Date: | Mon, 23 Aug 2004 09:38:51 +0000 |
| Subject: | FW: [PEAR] dataobject : problem with insert function | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-14232@lists.php.net to get a copy of this message | ||
OK, I see.
Try using
$this->keys('');
instead of
$this->keys(null);
Does it work without a notice?
Best regards, Denis Gerasimov
Outsourcing Services Manager,
VEKOS, Ltd.
www.vekos.ru
> -----Original Message-----
> From: Ludovic LAURENT [mailto:ludov.laurent@laposte.net]
> Sent: Monday, August 23, 2004 1:24 PM
> To: Denis Gerasimov
> Subject: Re: [PEAR] dataobject : problem with insert function
>
> I've a problem,
>
> function insert(){
>
> DB_DataObject::DebugLevel(1);
>
> $this->rubcode=156486;
>
> $keys = $this->keys();
>
> $this->keys(null);
>
>
>
> parent::insert();
>
> $this->keys('rubcode');
>
>
> }
>
>
>
> When I use this function, i've the following error message :
>
>
>
> Notice: Undefined index: in /usr/local/lib/php/pear/DB/DataObject.php on
> line 1795
>
> ----- Original Message -----
> From: "Denis Gerasimov" <denis.gerasimov@vekos.ru>
> To: "'mike'" <laurent.ludovic@free.fr>
> Sent: Monday, August 23, 2004 10:02 AM
> Subject: RE: [PEAR] dataobject : problem with insert function
>
>
> >
> > Hello,
> >
> > Is this a primary key for your table?
> >
> > If so, you may call $this->keys(null) to reset primary keys of the
> table.
> > Then insertion will go fine.
> > But don't forget to restore them if you need them later in you code. For
> > example:
> >
> > $keys = $this->keys();
> > $this->keys(null);
> >
> > // performing insertion here...
> >
> > $this->keys($keys);
> >
> > Best regards, Denis Gerasimov
> > Outsourcing Services Manager,
> > VEKOS, Ltd.
> > www.vekos.ru
> >
> > -----Original Message-----
> > From: mike [mailto:laurent.ludovic@free.fr]
> > Sent: Monday, August 23, 2004 11:45 AM
> > To: pear-general@lists.php.net
> > Subject: [PEAR] dataobject : problem with insert function
> >
> > Hi,
> >
> > I would like redefine insert function because I need to set the key
> value.
> > But Dataobject ignore the value that I give it.
> > Here's the function :
> >
> > function insert(){
> >
> > DB_DataObject::DebugLevel(1);
> >
> > $this->rubcode=81;
> >
> >
> > parent::insert();
> >
> >
> > }
> >
> >
> >
> > Normally, I should have 81 for the insert value, really, I have the
> value
> 9,
> > dataobject does not take into account my value. What have I to do?
> >
> > --
> > PEAR General Mailing List (http://pear.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >