title: How to return a result from a SQLite SELECT?
body: <p>I'm trying to pass the result from an SQLite <code>SELECT</code> to the var res and show it but in the alert I get "undefined". How to correctly return it?</p>
  
  <pre><code>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);
  </code></pre>