@kinkaz wrote:
Hey everyone,
I am trying to use the SQLite cordova plugin on my Ionic 2 app.
My code looks like this :
this.platform.ready().then(() => { let options = { name : "my_db" }; this.storage = new Storage(SqlStorage, options); this.storage.query("CREATE TABLE IF NOT EXISTS categories (id INTEGER PRIMARY KEY AUTOINCREMENT, name VARCHAR(50))", []).then((data) => { console.log("New table : " + JSON.stringify(data)); }, (error) => { console.log(error); }); });
And I'm getting an error I don't really understand (at least in this case) : number of '?'s in statement string does not match argument count.
I installed cordova-sqlite-plugin, even though I'm pretty sure it's only used on a real phone/emulator, so I don't think this should be causing any problem.
What did I do wrong ?
Thanks,
kinkaz
Posts: 3
Participants: 2