db.transaction(function (tx) {
tx.executeSql(
"SELECT COUNT(*) as id FROM offline_post WHERE link=? and author=? and title=?",
[link, create, title],
function (tx, results) {
alert(results.rows[0].id);
}
);
});
Cannot read property 'id' of undefined
SOLVED
I solved the problem in this way :)
db.transaction(function(tx) {
tx.executeSql('SELECT * FROM offline_post', [], function(tx, results) {
//resolve the promise passing the count data
alert(results.rows.length);
});
});