db\pgsql\QueryBuilder insert()

insert() public method

Creates an INSERT SQL statement.

For example,

$sql = $queryBuilder->insert('user', [
    'name' => 'Sam',
    'age' => 30,
], $params);

The method will properly escape the table and column names.

public string insert ( $table, $columns, &$params )
$table string

The table that new rows will be inserted into.

$columns array

The column data (name => value) to be inserted into the table.

$params array

The binding parameters that will be generated by this method. They should be bound to the DB command later.

return string

The INSERT SQL

doc_Yii
2016-10-30 16:58:45
Comments
Leave a Comment

Please login to continue.