db\Command delete()

delete() public method

Creates a DELETE command.

For example,

$connection->createCommand()->delete('user', 'status = 0')->execute();

The method will properly escape the table and column names.

Note that the created command is not executed until execute() is called.

public $this delete ( $table, $condition = '', $params = [] )
$table string

The table where the data will be deleted from.

$condition string|array

The condition that will be put in the WHERE part. Please refer to yii\db\Query::where() on how to specify condition.

$params array

The parameters to be bound to the command

return $this

The command object itself

doc_Yii
2016-10-30 16:57:24
Comments
Leave a Comment

Please login to continue.