Ionic-cordova-SQLite can Array be inserted as parameter?
I just wrote a simple function that creates an INSERT string for me from the user input, so I get something like this (working with ionic btw):
INSERT INTO people(firstname, lastname) VALUES (??)
Now I would like to use an array that contains the input values as a parameter:
let inputvalues = ["value1", "value2"];
this.database.executeSql(this.createInserString("people",this.userData), [inputvalues]).then((data) => {
console.log("INSERTED: " + JSON.stringify(data));
}, (error) => {
console.log("ERROR-Insert: " + JSON.stringify(error.err));
});
Is there a way to implement something like this? (because otherwise I have to type all single inputs and ... there are many ;-()
Thank!
+3
source to share