added ability to query mysql database

This commit is contained in:
Joe-Dowd
2020-07-05 04:14:15 +01:00
parent 325981b9c9
commit 46dd16caf9
22 changed files with 183 additions and 114 deletions

View File

@@ -14,7 +14,7 @@ module.exports = function getViewsForUser(req, res) {
userID = getHash(userID);
try {
let row = db.prepare("SELECT SUM(views) as viewCount FROM sponsorTimes WHERE userID = ?").get(userID);
let row = db.prepare('get', "SELECT SUM(views) as viewCount FROM sponsorTimes WHERE userID = ?", [userID]);
//increase the view count by one
if (row.viewCount != null) {