let query=()=>{
return new Promise((resolve,rejct)=>{
let sql ='SELECT * FROM users'
connection.query(sql,(err,result)=>{
if(err){
console.log(err,'查询失败')
}else{
resolve(result)
}
})
})
}
return query()
let query=()=>{
return new Promise((resolve,rejct)=>{
let sql ='SELECT * FROM users'
connection.query(sql,(err,result)=>{
if(err){
console.log(err,'查询失败')
}else{
resolve(result)
}
})
})
}
return query()