title: Nested query in node js using mysql
body: <p>I am trying following code at node js using mysql but getting error "Cannot enqueue Query after invoking quit. </p>
  
  <pre><code>var mysql = require('mysql');
  
  var connection = mysql.createConnection({
  host     : 'localhost',
  user     : 'USER',
  password : 'PASS',
  database : 'DB',
  });
  
  connection.connect();
  
  var queryString = 'SELECT * FROM tbl_product';
  
  connection.query(queryString, function(err, rows, fields) {
      if (err) throw err;
      for (var i in rows) {
          console.log('Product Name: ', rows[i].product_name);
          var emp_query = 'SELECT * FROM tbl_employer';
          connection.query(queryString, function(emp_err, emp_rows, emp_fields) {
              if (emp_err) throw emp_err;
              for (var e in emp_rows) {
                  console.log('Employer Name: ', emp_rows[e].company_name);
              }
          }); 
      }
  });  
  connection.end(); 
  </code></pre>