running multiple queries at same time

Solutions on MaxInterview for running multiple queries at same time by the best coders in the world

showing results for - "running multiple queries at same time"
Teo
05 Jan 2018
1var pool  = mysql.createPool({
2  connectionLimit : 10,
3  host            : 'example.org',
4  user            : 'bobby',
5  password        : 'pass',
6  database        : 'schema'
7});
8
9for(var i=0;i<10;i++){
10  pool.query('SELECT ` as example', function(err, rows, fields) {
11    if (err) throw err;
12    console.log(rows[0].example); //Show 1
13  });
14 }
15