I am trying to insert an array into my sqlite database. But all the data is getting inserted into the first column. Please help. I already checked these :
https://github.com/litehelpers/Cordova-sqlite-storage/issues/392
sqlite3 insert into dynamic table
But not able to solve my problem.
my code is
let insertarr:Array;
for(var i=0;i<this.fullData.length;i++)
{
insertarr = [];
for(var j=0;j<this.fullData[i].length;j++)
{
insertarr.push(this.fullData[i][j].val);
}
alert(insertarr);
db.executeSql('insert into mytable (col1, col2, col3) values(?,?,?)', [insertarr]);
}
When I run the above code col1 is getting populated with the full array. col2 and col3 are populated with null.