Edit this page

DELETE Query Builder

The simplest DELETE statement example:

$delete = new Delete();
$delete->where('id', 5);


Db::delete('user')->where('id', 5)->exec();

Beware that if you forget WHERE statement(s), you'll delete entire table.

You can use WHERE statements on delete query builder so you can build complex where conditions.

To get how many rows was deleted from table, use:

$rowsDeleted = $delete->rowCount();