Skip to content

Commit

Permalink
Fixed a documentation error regarding Multiple insert (#737)
Browse files Browse the repository at this point in the history
the current docs show that you can pass each row to be inserted as additional params to the query method, however when you try to do that it errors.  In looking up this error here: https://forum.nette.org/en/21412-nette-database-insert-multiple-rows-in-one-query I realized that the multiple rows need to be passed as an array in the second argument which solved the problem.
  • Loading branch information
tempcke authored and dg committed Nov 27, 2018
1 parent 631aea8 commit 31da458
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions en/database-core.texy
Expand Up @@ -125,11 +125,13 @@ Multiple insert:

/--php
$database->query('INSERT INTO users', [
'name' => 'Jim',
'year' => 1978,
], [
'name' => 'Jack',
'year' => 1987,
[
'name' => 'Jim',
'year' => 1978,
], [
'name' => 'Jack',
'year' => 1987,
]
]);
// INSERT INTO users (`name`, `year`) VALUES ('Jim', 1978), ('Jack', 1987)
\--
Expand Down

0 comments on commit 31da458

Please sign in to comment.