Reputation: 1627
var db = window.openDatabase("Database", "1.0", "userData", 200000);
console.log(db);
db.transaction(populateDB, errorCB, successCB);
function populateDB(tx) {
tx.executeSql('CREATE TABLE IF NOT EXISTS USER (id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, api_key TEXT NOT NULL, username TEXT NOT NULL)');
tx.executeSql('INSERT INTO USER (api_key, username) VALUES ( "asd", row")');
}
function errorCB(err) {
console.log("Error processing SQL: "+err.message);
}
function successCB() {
console.log("success!");
}
First SQL statements executes, but then the second one returns:
could not prepare statement (1 unrecognized token: "")") //with error code 5
. Any ideas why?
I am following the PhoneGap Docs at here
Upvotes: 2
Views: 4503