You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
@@ -109,7 +109,9 @@ public static function get_top(int $limit): array
$table = self::$table;
$db = self::connection();
$query = $db->prepare("SELECT users.*,(SELECT COUNT(*) FROM game_logs WHERE user_id=users.id) AS level_count FROM $table ORDER BY level_count DESC LIMIT $limit");
$query = $db->prepare(
"SELECT users.*, COUNT(game_logs.id) as level_count FROM $table inner join game_logs on users.id=game_logs.user_id GROUP BY users.id ORDER BY `level_count` DESC LIMIT $limit"