0
の入力に1つのクエリの出力を使用するには、私は別のクエリにクエリの入力出力したいのNode.js:どのように私はNode.jsのに新しいです別のクエリ
pool.getConnection(function(err, connection) {
connection.query("select * from tbl_chat", function(err, rows) {
console.log(rows[0]['from_id']);
var fromid = rows[0]['from_id'];
});
console.log(fromid);//throws ReferenceError: fromid is not defined
console.log(rows[0]['from_id']);// throws ReferenceError: rows is not defined
//I want to use the fromid in the following query
/*connection.query("select * from tbl_chat where from_id=?",[fromid], function(err, rows) {
console.log(rows[0]['from_id']);
});*/
});