HI Max,
the Phonegap API does not work. and when i mean does not work i mean i cannot see the prints of querySuccess function, which suppose to print the DB content.
this is how i invoke the API, this code runs when you click the "Show My Location" button:
var db = window.openDatabase("Database", "1.0", "PhoneGap Demo", 200000);
db.transaction(populateDB, errorCB, successCB);
this are the public functions:
function populateDB(tx) {
tx.executeSql('DROP TABLE IF EXISTS DEMO');
tx.executeSql('CREATE TABLE IF NOT EXISTS DEMO (id unique, data)');
tx.executeSql('INSERT INTO DEMO (id, data) VALUES (1, "First row")');
tx.executeSql('INSERT INTO DEMO (id, data) VALUES (2, "Second row")');
}
function errorCB(err) {
alert("Error processing SQL: " + err);
}
function successCB() {
alert("success!");
}
function queryDB(tx) {
tx.executeSql('SELECT * FROM DEMO', [], querySuccess, errorCB);
}
function querySuccess(tx, results) {
// this will be empty since no rows were inserted.
alert("Insert ID = " + results.insertId);
// this will be 0 since it is a select statement
alert("Rows Affected = " + results.rowAffected);
// the number of rows returned by the select statement
alert("Insert ID = " + results.rows.length);
}
function errorCB(err) {
alert("Error processing SQL: " + err.code);
}