我下面有一个nodejs代码。当我提供有效的数据时,sql查询会完美运行,如果在sql中没有可用的输入,它将返回空结果(结果[])。如果结果为空数组,如何将其呈现到另一页?>
app.post('/verify',urlencodedParser,async function(req,res){///////////// verify form
var reg1 = req.body.regno;
console.log("reg");
console.log(reg1);
sql ="select * from json where id="+db.escape(reg1);
db.query(sql,async(err,resulter)=>{
if (err) throw err;
console.log("my result:",resulter);
console.log(resulter[0].name);
jname = resulter[0].name;
var contents = JSON.parse(fs.readFileSync(path1 + "/public/issued_json/"+jname, 'utf8'));
console.log(contents);
console.log(JSON.stringify(contents.employee[0]));