Commit feb6fc38 authored by Rosanny Sihombing's avatar Rosanny Sihombing
Browse files

fix db connection

parent 69ab56ca
......@@ -183,7 +183,7 @@ module.exports = function (app, config, passport) {
if (req.isAuthenticated()) {
if (userData.email) {
dbconn.query('UPDATE user SET ? WHERE email = "' +userData.email+'"', userData, function (err, rows, fields) {
dbconn.user.query('UPDATE user SET ? WHERE email = "' +userData.email+'"', userData, function (err, rows, fields) {
//if (err) throw err;
if (err) {
req.flash('error', "Failed");
......@@ -208,7 +208,7 @@ module.exports = function (app, config, passport) {
var retypePwd = req.body.inputConfirm
// Load hashed passwd from DB.
dbconn.query('SELECT password FROM user WHERE email="'+req.user.email+'"', function (err, rows, fields) {
dbconn.user.query('SELECT password FROM user WHERE email="'+req.user.email+'"', function (err, rows, fields) {
if (err) {
res.redirect('/500')
throw err
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment