title: Return a COUNT from a WebSQL query in a javaScript function
body: <p>I want to return the number of rows in a particular table in a database in <code>WebSQL</code> inside a <code>javascript</code> function. Below is my code.<br></p>
  
  <pre><code>function getCustomerCount(){    
      var count = 0;  
      db.transaction(function(tx) {   
      tx.executeSql('SELECT * FROM contacts', [], function(tx, results) {
               count = results.rows.length;   
          });
      });
      return count;
  }
  </code></pre>
  
  <p><br>
  I am new to <code>WebSQL</code> and rather unfamiliar with <code>javascript</code> also.<br>
  Any suggestions? </p>