Problem with DataObject and Update
| From: | Jose Manuel Zea | Date: | Wed, 12 Apr 2006 11:56:55 +0000 |
| Subject: | Problem with DataObject and Update | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-23624@lists.php.net to get a copy of this message | ||
Hi:
Under PHP5 and using the last stable package for DB_DataObject, I´m having a
problem when I try to update several rows.
Some of the fields in the table are:
CREATE TABLE
inmuebles (
codinmueble int(10) unsigned NOT NULL auto_increment,
(
)
codpromocion int(11) default NULL,
publicado tinyint(1) NOT NULL default '0',
(
)
PRIMARY KEY (codinmueble)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
When I want to update the field publicado (means published, it´s a boolean
value for me) to value 1 or 0 querying by the codpromocion value, I do for
example the next thing:
$data = new DO_Inmuebles;
$data->publicado=1;
$data->whereAdd('codpromocion=1');
if ($data->update()>0){
echo It works!!!;
}
And nothing happens. But if I do the next, to update the value querying by
the primary key:
$data = new DO_Inmuebles;
$data->publicado=1;
$data ->do->get(1);
if ($data->update()>0){
echo It works!!!;
}
It seems it´s not working when need to update several rows instead of just
one.
Can anyone help me?
Regards,
Jose Manuel Zea
______________________________________________
LLama Gratis a cualquier PC del Mundo.
Llamadas a fijos y móviles desde 1 céntimo por minuto.
http://es.voice.yahoo.com