batchInsert() public method
Generates a batch INSERT SQL statement.
For example,
$sql = $queryBuilder->batchInsert('user', ['name', 'age'], [
['Tom', 30],
['Jane', 20],
['Linda', 25],
]);
Note that the values in each row must match the corresponding column names.
The method will properly escape the column names, and quote the values to be inserted.
| public string batchInsert ( $table, $columns, $rows ) | ||
|---|---|---|
| $table | string |
The table that new rows will be inserted into. |
| $columns | array |
The column names |
| $rows | array |
The rows to be batch inserted into the table |
| return | string |
The batch INSERT SQL statement |
Please login to continue.