連著2次connect 或 end 都會報錯
可以一開始就連接mysql 然后不斷開,一直連著,以后就不連接,這樣就不會錯了,
connection.connect();
router.get("/index",function(req,res){
????connection.query(addSql,addSqlParams,function(err,rows){
????????if(err){
????????????var response = {title:"用戶列表",datas:[],err:err};
????????}else {
????????????var response = {title:"用戶列表",datas:rows} ;
????????}
? ? });
?????connection.end();(刪除這行)
});