db\QueryBuilder delete()

delete() public method

Creates a DELETE SQL statement.

For example,

$sql = $queryBuilder->delete('user', 'status = 0');

The method will properly escape the table and column names.

public string delete ( $table, $condition, &$params )
$table string

The table where the data will be deleted from.

$condition array|string

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 binding parameters that will be modified by this method so that they can be bound to the DB command later.

return string

The DELETE SQL

doc_Yii
2016-10-30 16:59:18
Comments
Leave a Comment

Please login to continue.