title: How to insert multiple rows in Web SQL Database?
body: <p>I have a JavaScript object with multiple rows of data and I want to insert it into web sql database.
  Here is how my code looks like.</p>
  
  <pre><code>for(i in rows)
  {
      (function(row){
          db.transaction(function(tx) {
              tx.executeSql("INSERT INTO my_table (id, name, parent_id) VALUES (?, ?, ?)",
                  [ row.id, row.name, row.parent_id ], onSuccess, onError
              );
          });
      })(rows[i]);
  }
  </code></pre>
  
  <p>My questions about this are:</p>
  
  <ol>
  <li>This can be done by moving outer loop inside <code>db.transaction</code>. Will it be better and why?</li>
  <li>Is it possible to add multiple rows in single query like multiple values in single MySQL <code>INSERT</code>? Or I should not worry about this.</li>
  </ol>