For example,
php
$sql = $queryBuilder->insert('user', [
'name' => 'Sam',
'age' => 30,
], $params);
The method will properly escape the table and column names.
public insert ( string $table, array $columns, array &$params ) : string | ||
$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 |