Re: RV: [PEAR] Problem with DataObject and Update
| From: | arnaud sellenet bodin | Date: | Wed, 12 Apr 2006 14:24:08 +0000 |
| Subject: | Re: RV: [PEAR] Problem with DataObject and Update | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-23628@lists.php.net to get a copy of this message | ||
Le 12 avr. 06 à 16:04, Nicholas Costa a écrit :
Jose, You need to use the constant DB_DATAOBJECT_WHEREADD_ONLY as the argument to DB_DataObject::update(). This allows for multiple row updates by ignoring the primary key field set for your table. It is documented on http://pear.php.net/manual/en/package.database.db-dataobject.db-dataobject.update.php . This sample should get you going: $data = new DO_Inmuebles; $data->publicado = 1; $data->whereAdd( 'codpromocion = 1' );if($data->update( DB_DATAOBJECT_WHEREADD_ONLY ) > 0) // passes constant to update(){ echo ‘It works!!!’; } Buena suerte! HTH, Nick Wow, this is nice a feature I hadn't noticed !