我正在使用mysql和node。我只需要打印一个'部分'的查询结果和这个'部分'是设置为不同的每一次。
// var val = any one of a,b,c or d.
// This is updated by some other part of code.
con.query("SELECT a,b,c,d FROM new_table LIMIT 1",
function(error, results, fields) {
if (error)
throw error;
我只想打印“val”表示的列中的数据,而不打印其他列中的数据。既然‘val’的值是动态变化的,我该如何处理这个问题呢?
console.log(results.val);
这好像不行,这也不行,
console.log(results.'val');
暂无答案!
目前还没有任何答案,快来回答吧!