node.js怎么取出方法中connection.query方法中functionresult的值
2个回答
展开全部
throw err;
}else{
connection.query("SELECT * FROM cash_daily_coin WHERE uid_fk="+results[0].uid+"",
function selectCb(err, daily, fields) {
if (err) {
throw err;
}else{
var datas = resultss[0];
datas.deviceid = deviceid;
datas.todaycoin = daily[0].todaycoin;
req.session["user"] = datas;
res.jsonp(datas);//返回JSON
}
}
);
}else{
connection.query("SELECT * FROM cash_daily_coin WHERE uid_fk="+results[0].uid+"",
function selectCb(err, daily, fields) {
if (err) {
throw err;
}else{
var datas = resultss[0];
datas.deviceid = deviceid;
datas.todaycoin = daily[0].todaycoin;
req.session["user"] = datas;
res.jsonp(datas);//返回JSON
}
}
);
引用北上广的醋坛子的回答:
throw err;
}else{
connection.query("SELECT * FROM cash_daily_coin WHERE uid_fk="+results[0].uid+"",
function selectCb(err, daily, fields) {
if (err) {
throw err;
}else{
var datas = resultss[0];
datas.deviceid = deviceid;
datas.todaycoin = daily[0].todaycoin;
req.session["user"] = datas;
res.jsonp(datas);//返回JSON
}
}
);
throw err;
}else{
connection.query("SELECT * FROM cash_daily_coin WHERE uid_fk="+results[0].uid+"",
function selectCb(err, daily, fields) {
if (err) {
throw err;
}else{
var datas = resultss[0];
datas.deviceid = deviceid;
datas.todaycoin = daily[0].todaycoin;
req.session["user"] = datas;
res.jsonp(datas);//返回JSON
}
}
);
展开全部
里面写一个回掉函数,
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询