Can't get values from Sqlite DB using query
- by Sana Joseph
I used sqlite to populate a DB with some Tables in it.
I made a function at another javascript page that executes the database & selects some values from the table.
Javascript:
function GetSubjectsFromDB()
{
tx.executeSql('SELECT * FROM Subjects', [], queryNSuccess, errorCB);
}
function queryNSuccess(tx, results) {
alert("Query Success");
console.log("Returned rows = " + results.rows.length);
if (!results.rowsAffected) {
console.log('No rows affected!');
return false;
}
console.log("Last inserted row ID = " + results.insertId);
}
function errorCB(err) {
alert("Error processing SQL: "+err.code);
}
Is there some problem with this line ?
tx.executeSql('SELECT * FROM Subjects', [], queryNSuccess, errorCB);
The queryNSuccess isn't called, neither is the errorCB so I don't know what's wrong.