我是这样从路由器将数据发送到玉页面的:
router.get('/allUsers', function(req, res, next) {
con.connect(function(err) {
if (err) throw err;
con.query("SELECT name,surname,teacher_id,lesson_id,reg_Date FROM maven_test.student",
function (err, result, fields) {
if (err) throw err;
res.render('users', { student_data:result });
});
});
});
我想将此数据设置为这样的表:
#studentDataDiv center table#studentTable(cellspacing='2', cellpadding='2', width='100%', border='1px solid green') thead tr th Student name th Student surname tbody - each item in student_data tr td=item.name td=item.surname
但是我遇到了这样的错误:
此块从不使用。此警告将是v2.0.0中的错误
GET / users / allUsers 500 2104.946 ms-143
如何执行此操作?