I try to insert data into a local database sqlite. Its possible. I can do it . But I have to create a new table every time. I try to do it without creating a new table...
I already insert the data into the table but I had to create a table every time.
$("#ecris").click( function()
{
var fs = require("fs");
var sql = require("./js/sql.js");
var db = new sql.Database();
db.run("CREATE TABLE test (col1, col2);");
db.run("INSERT INTO test (col1, col2) VALUES ('8','4564')");
;
var data = db.export();
var buffer = new Buffer(data);
fs.writeFileSync("bd/mybd.sqlite", buffer );
db.close();
});
I just need the insert into the existing table... thanks a lot