Version: v2.4.0
delete
Delete records from a table.
delete($table, $where)
table [string]
The name of the table.
where [array]
The WHERE clause used to filter the records to be deleted.
Return Value
[PDOStatement] The PDOStatement instance for the executed query.
$database->delete("account", [
"AND" => [
"type" => "business",
"age[<]" => 18
]
]);
// `delete()` returns a PDOStatement, so you can call its methods for additional details.
$data = $database->delete("account", [
"AND" => [
"type" => "business",
"age[<]" => 18
]
]);
// Returns the number of rows affected by the last SQL statement.
echo $data->rowCount();
// Reference: https://php.net/manual/en/class.pdostatement.php