title: Display SQL Query Result in HTML
body: <p>I need to use javascript and HTML5 to display the result of the following SQL query in my html page. The SQL query works in SQLite Browser, but I am unsure of how to write the function and corresponding HTML5 code to call the function to display the result of my query. The SQL Query is as follows:</p>
  
  <pre><code>SELECT SUM(Orders.productQty * Products.productPrice) AS grandTotal FROM Orders JOIN Products ON Products.productID = Orders.productID
  </code></pre>
  
  <p>This returns a numerical result from my SQLite database that is already created, but I do not get how to display the result of the select query on my webpage.</p>
  
  <p>I've tried using the following function to execute the sql statement, but I do not know how to display it using HTML.</p>
  
  <pre><code>function calculateTotalDue() {
  db.transaction(function (tx) {
      tx.executeSql('SELECT SUM(Orders.productQty * Products.productPrice) AS grandTotal FROM Orders JOIN Products ON Products.productID = Orders.productID', [], []);
  });
  </code></pre>
  
  <p>}</p>
  
  <p>Would someone please show me how to display the result of the query in my html page?</p>