In a chrome extension, I am encountering an issue with the following code:
var DB = openDatabase('CMPDB', '1.0', 'Database for CMP', 4 * 1024 * 1024);
LoadFromDB();
function LoadFromDB() {
DB.transaction( function(tx)
{
tx.executeSql('CREATE TABLE IF NOT EXISTS table(X, Y, Z UNIQUE)');
tx.executeSql('SELECT * FROM table', [], function (tx, results) {
var len = results.rows.length;
for (i = 0; i < len; i++) {
alert(results.rows.item(i).X.text);
alert(results.rows.item(i).Y.text);
alert(results.rows.item(i).Z.text);
}
});
});
}
I'm puzzled as to why all of the alerts are returning undefined even though the table has been created beforehand and the Chrome Dev tools show that values exist in the table. Any insights on this perplexing situation?