I'm trying to retrieve data from a db, to be precise a count, that I want to return from the function but it keeps returning me "Undefined". I'm using phonegap!
database.prototype.getNumberOfActions = function () {
var numAct;
var db = window.openDatabase("Database", "1.0", "PhoneGap Demo", 200000);
db.transaction (function(tx){
tx.executeSql('SELECT COUNT(*) AS conta FROM DB WHERE (((id >=' +idI + ') AND (anno >=' +annoI+')) OR (anno >'+ annoI+ '))) AND (fatto = true)',[], function(tx,results){numAct = results.rows.item(0).conta;},null); },null); return numAct;};`