sphinx\QueryBuilder batchInsert()

batchInsert() public method

Generates a batch INSERT SQL statement.

For example,

$sql = $queryBuilder->batchInsert('idx_user', ['id', 'name', 'age'], [
    [1, 'Tom', 30],
    [2, 'Jane', 20],
    [3, 'Linda', 25],
], $params);

Note that the values in each row must match the corresponding column names.

public string batchInsert ( $index, $columns, $rows, &$params )
$index string

The index that new rows will be inserted into.

$columns array

The column names

$rows array

The rows to be batch inserted into the index

$params array

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

return string

The batch INSERT SQL statement

doc_Yii
2016-10-30 17:12:25
Comments
Leave a Comment

Please login to continue.