Fix: print ranking list with my rank

This commit is contained in:
2018-05-18 10:28:16 +09:00
parent 60bd151c92
commit 2cecc26e12
5 changed files with 107 additions and 31 deletions
+12 -3
View File
@@ -10,12 +10,21 @@ include "./../setup/connect_db.php";
// ranking month
/*
$query = "
SELECT D.userID As UserID, U.Name AS Name, MAX(D.score) AS HighScore
FROM afterschool_record D, afterschool_user U
SELECT D.userID As UserID, U.Name AS Name, MAX(D.Score) AS HighScore
FROM moty_record D, moty_user U
WHERE D.userID = U.userID AND MONTH(D.DateTime) = MONTH(NOW()) AND AppName = ?
GROUP BY D.userID
ORDER BY max(D.Record) DESC;
ORDER BY max(D.Score) DESC;
";
*/
$query = "
SELECT D.userID As UserID, U.Name AS Name, MAX(D.Score) AS HighScore
FROM moty_record D, moty_user U
WHERE D.userID = U.userID AND MONTH(D.DateTime) = MONTH('2018-05-18') AND AppName = 'korean_word'
GROUP BY D.userID
ORDER BY max(D.Score) DESC;
";
$stmt = $db_conn->prepare($query);
$stmt->bind_param('s', $app_name);