-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MySQL is updated if user remembers word
- Loading branch information
1 parent
5c615af
commit 1b25af6
Showing
3 changed files
with
27 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module.exports = function(req, res) { | ||
remword = function(userid, wordid) { | ||
connection.query("UPDATE ?? SET progress = progress + 1, daterev = ADDDATE(daterev, 2*progress) WHERE id = ?", | ||
[userid, wordid], function(err, rows) { | ||
if (err) throw err; | ||
}); | ||
} | ||
}; | ||
var mysql = require('mysql'); | ||
var dbconfig = require('../config/database'); | ||
var bcrypt = require('bcrypt-nodejs'); | ||
var connection = mysql.createConnection(dbconfig.connection); | ||
connection.query('USE ' + dbconfig.database); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters