Db::update
Usage
void Db::update(string $table_name, object | array $updates, [ ... $args ])Description
Update one or more records within a database table.Parameters
Parameter | Required | Type | Description |
---|---|---|---|
$table_name | Yes | string | Table name to update records within. |
$updates | Yes | object | array | Associative array of updates to make on any matching records. |
$where_sql | No | string | The where clause of the update statement, and can include placeholders (ie. %s, %i, %b, et al) |
$args | No | desc= |
Examples
Update
// Update products
$this->update('products', [
'is_active' => false
], 'category_id = %i', 13);