->update()

->update() -- Update objects variables into database

Referentiesamenvatting

int $DB_DataObject->update ([dataobject|boolean $original|$useWhere])

Beschrijving

Updates current objects variables into the database. if you supply it with a dataObject, as an argument, it will only update the differences between the new and old.

if called with DB_DATAOBJECT_WHEREADD_ONLY as the argument, the update request is built based on the whereAdd values, rather than the primary key. This enables global updates to be performed, rather than single row ones.

Parameter

Return waarde

int number of rows affected or FALSE on failure

Throws

Tabel 34-1. Mogelijke PEAR_Error waarden

Error codeError messageMeaningSolution
DB_DATAOBJECT_ERROR_INVALIDCONFIG"update:No table definition for $table"  
DB_DATAOBJECT_ERROR_NODATA"update: No Data specifed for query $settings"  

Note

Deze functie kan niet statisch worden aangeroepen.

Voorbeeld