NodeJS - how can get mysql result with executed query?

Ank*_*iya 1 javascript mysql sql node.js

I am new in NodeJS with mysql (npm install mysql).

当我尝试执行查询时

connection.query("select ?? from users where id = ?",[["id","fname","lname"],req.body.userid],function (err, rows) {
     **here I want query which above executed**
});
Run Code Online (Sandbox Code Playgroud)

I want query in callback function which executed.

我怎么才能得到它??。

yos*_*reb 5

var c = connection.query("select ?? from users where id = ?",[["id","fname","lname"],req.body.userid],function (err, rows) {
     console.log(c.sql)
});
Run Code Online (Sandbox Code Playgroud)