->update()
Описание
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.
Параметр
DataObject $original - if provided the update query will be built from the difference between the current and original dataobject.
Throws
Таблица 35-1. Возможные значения PEAR_Error
Error code | Error message | Meaning | Solution |
---|---|---|---|
DB_DATAOBJECT_ERROR_INVALIDCONFIG | "update:No table definition for $table" | ||
DB_DATAOBJECT_ERROR_NODATA | "update: No Data specifed for query $settings" |
Пример
Пример 35-1. Simple fetch and update
|
Пример 35-2. Resulting SQL
|
Пример 35-3. Simple fetch and update
|
Пример 35-4. Resulting SQL
|
Пред. | Начало | След. |
->insert() | Уровень выше | ->delete() |