MySQL的查询数据能在另一个页面接受到吗
发布于 11 年前 作者 yaoqi404 3570 次浏览 最后一次编辑是 8 年前

我在这个文件查询的数据,能在另一个页面返回来嘛?

exports.p=function(sql){

connection.query(sql,function(err,fields){

    //return this.fields;
return fields;

}) };

上面这个是查询页的代码

var config=require('./config');

var sql=“select * from user”; console.log(config.p(sql))

这个是需要接受的页面代码

回到顶部