batchInsert() public method
Creates a batch INSERT command.
For example,
$connection->createCommand()->batchInsert('idx_user', ['name', 'age'], [ ['Tom', 30], ['Jane', 20], ['Linda', 25], ])->execute();
Note that the values in each row must match the corresponding column names.
public $this batchInsert ( $index, $columns, $rows ) | ||
---|---|---|
$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 |
return | $this |
The command object itself |
Please login to continue.