Graduate

Change webserver query

......@@ -10,7 +10,7 @@ router.get('/:lecture_id', function(req, res, next) {
var lecture_id = req.params.lecture_id;
pool.getConnection(function(err, conn){
conn.query('select * from lecture;', function (err, rows){
conn.query('select * from lecture where lecture_id = ?;', [lecture_id], function (err, rows){
if (err) return res.status(500).json({error: err});
if (!rows) return res.status(400).json({error: 'not found'});
var msg = {
......
......@@ -10,7 +10,7 @@ router.get('/:lecture_id', function(req, res, next) {
var lecture_id = req.params.lecture_id;
pool.getConnection(function(err, conn){
conn.query('select s.student_id AS student_id, s.student_name AS student_name from lecture_students l JOIN student s USING (student_id);', function (err, rows){
conn.query('select s.student_id AS student_id, s.student_name AS student_name from lecture_students l JOIN student s USING (student_id) where l.lecture_id=?;', [lecture_id], function (err, rows){
if (err) return res.status(500).json({error: err});
if (!rows) return res.status(400).json({error: 'not found'});
var msg = {
......