Version: v2.3.0
replace
Replace records in a table. Existing records with a matching primary key are deleted and reinserted; otherwise, a new record is inserted.
replace($table, $columns, $where)
table [string]
The name of the table.
columns [array]
The column-value pairs that define the replacement mapping.
where [array] (optional)
The WHERE clause used to filter the target records.
Return Value
[PDOStatement] The PDOStatement instance for the executed query.
$database->replace("account", [
"type" => [
"user" => "new_user",
"business" => "new_business"
],
"column" => [
"old_value" => "new_value"
]
], [
"user_id[>]" => 1000
]);