nodejs 使用mysql 进行查询的问题

因为返回的是个对象

var selectSql1="select * from spc_word_mst where WORD_ID=? limit 0,1 "
var selectSql2="select * from spc_baitai_mst where BAITAI_ID=? limit 0,1"
//SPC_Result_JH
var insertsql="insert into";

var key1='001';
var key2='001';
conn.query(selectSql1,[key1],function(error,rows){
if(error) console.log(error)
console.log("select==");
var wordname=new String(rows[0].WORD_NAME);//取得字段值
console.log(wordname);
conn.query(selectSql2,[key2],function(error1,rows){
if(error1) console.log(error1)
console.log("select==");
var url=new String(rows[0].BAITAI_URL);//取得字段值
console.log(url);
});
});

转载于:https://www.cnblogs.com/c-x-a/p/5462180.html

最新回复(0)
/jishu0qfQLBv8ovTgw6C5lzbTyao3bJJYnuhAVL5vyA_3D_3D4795408
8 简首页