Fix: print ranking list with my rank
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user