Deletes records from a database. The second parameter must be specified for the method to be executed successfully.
Syntax
DB::Delete($table, $values)
// or
DB::Delete($table, $where)
Arguments
$table
the table from which the data is deleted.
$values
an array with values that define the condition for the delete query.
$where
the condition for the query; if unspecified, no action will be done.
Return value
No return value.
Example
// delete from Cars where id=50
$data = array();
$data["id"] = 50;
DB::Delete("cars", $data );
Alternative syntax:
// delete from Cars where id=50
DB::Delete("cars", "id=50" );
See also: