I have a select all statement from my sqlite table and my program never seems to get to it, or it doesn’t work. The alerts are there so I can see how far the code is going and I never get an alert passed table opened, which means it isn’t getting passed the select statement.
Can anybody help me solve this issue?
getData() {
this.sqlite.create({
name: 'ionicdb.db',
location: 'default'
}).then((db: SQLiteObject) => {
alert("table opened");
db.executeSql('SELECT * FROM alerts', []).then(resultSet=> {
alert("passed select");
this.alertsArray = [];
if(resultSet.res.rows.length > 0) {
for(let i = 0; i<resultSet.res.rows.length; i++) {
this.alertsArray.push({
"title":resultSet.res.rows.item(i).title,
"body":resultSet.res.rows.item(i).body})
alert("push items");
}
} //end of if
})
})
} //END OF GETDATA