I'm trying to pass the result from an SQLite SELECT
to the var res and show it but in the alert I get "undefined". How to correctly return it?
function read(key){
app.db.transaction(function(tx) {
tx.executeSql('SELECT value FROM MyTable WHERE key = ?',
[key],
function(tx, results)
{
return results.rows.item(0)['value']
},
app.onError
);
return;
});
return;
}
res=read("pipi")
alert(res);