Closed thureos closed 7 years ago
Hi,
I have this table on a sqlite db
CREATE TABLE "dependencies" ("sourcetype" VARCHAR NOT NULL , "sourceid" INTEGER NOT NULL , "targettype" VARCHAR NOT NULL , "targetid" INTEGER NOT NULL )
if I run this
$sqlite = new Medoo([ 'database_type' => 'sqlite', 'database_file' => 'db/db.sqlite', ]); $sqlite->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); //dumpJsonToFile('dependencies.json', $dependencies); $test = [ [ 'sourcetype' => '1', 'sourceid' => '1', 'targettype' => '1', 'targetid' => '1', ], [ 'sourcetype' => '2', 'sourceid' => '2', 'targettype' => '2', 'targetid' => '2', ], ]; $sqlite->debug()->insert('dependencies', $test); $sqlite->insert('dependencies', $test);
I got this
INSERT INTO "dependencies" ("sourcetype", "sourceid", "targettype", "targetid") VALUES ('1', '1', '1', '1'), ('2', '2', '2', '2') PHP Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 1 near ",": syntax error' in /PATH/vendor/catfan/medoo/src/Medoo.php:299
If you run the command it works but when you run it directly it throws an error.
Thanks!
What's your SQLite version? If you using 3.7.11 or above, it should be supported.
3.6.20 turns out that the server I'm working on is pretty old so... Thanks!
Hi,
I have this table on a sqlite db
if I run this
I got this
If you run the command it works but when you run it directly it throws an error.
Thanks!