I don't know javascript very well. I can't define a global variable.
var data = 'empty';
connection.query('SELECT * FROM deneme',function(err, rows, fields){
if (err) throw err;
data = rows;
});
console.log(data);
Normally, console need to return rows' data but It returns 'empty'. How can I query rows from inside of function? How can I define a global variable?