I am trying to insert into a database with SQLlite.
I have the following code:
function storeUserStatus(s) {
console.log("STATUS");
db.transaction(function(tx) {
tx.executeSql("INSERT INTO calculator (leadership, status, wealth, social, random, control) VALUES (?, ?, ?, ?, ?, ?)", [s[0], s[1], s[2], s[3], s[4], s[5]], function(success) {
console.log(success);
}),
function(err) {
console.log(err);
};
});
}
s is an array with only numeric values (both negative and positive), and the success callback is the callback getting executed.
Why is it not inserting? I try to do a query later on, and the query isn't finding any results.
The query I'm using to get the data (which is returning nothing) is this:
tx.executeSql('SELECT id FROM calculator ORDER BY id DESC LIMIT 1' ...
Why would I not be getting any resultset?
Aucun commentaire:
Enregistrer un commentaire