Skip to content

Commit

Permalink
Merge pull request #8 from startersclan/fix/fix-mysql-group-by-in-som…
Browse files Browse the repository at this point in the history
…e-pages

Fix: Fix MySQL Group By in some pages
  • Loading branch information
leojonathanoh committed Oct 29, 2023
2 parents 586ca46 + e6c1d41 commit 7eaef1a
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 9 deletions.
3 changes: 2 additions & 1 deletion web/pages/actioninfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@
hlstats_Events_PlayerActions.actionId = hlstats_Actions.id AND
hlstats_Players.hideranking = '0'
GROUP BY
hlstats_Events_PlayerActions.playerId
hlstats_Events_PlayerActions.playerId,
hlstats_Actions.reward_player
ORDER BY
$table->sort $table->sortorder,
$table->sort2 $table->sortorder
Expand Down
3 changes: 2 additions & 1 deletion web/pages/awards_ranks.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@
AND hlstats_Ranks.game='$game'
GROUP BY
rankName,
minKills
minKills,
rankId
");

while ($r = $db->fetch_array())
Expand Down
3 changes: 2 additions & 1 deletion web/pages/awards_ribbons.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@
hlstats_Ribbons.game='$game'
AND hlstats_Ribbons.special=0
GROUP BY
hlstats_Ribbons.ribbonId
hlstats_Ribbons.ribbonId,
awardName
ORDER BY
awardCount,
ribbonName,
Expand Down
6 changes: 4 additions & 2 deletions web/pages/playerinfo_general.php
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,8 @@
WHERE
hlstats_Events_Frags.killerId=$player
GROUP BY
hlstats_Events_Frags.weapon
hlstats_Events_Frags.weapon,
hlstats_Weapons.name
ORDER BY
kills desc, headshots desc
LIMIT
Expand Down Expand Up @@ -822,7 +823,8 @@ function setForumText(val)
OR hlstats_Ribbons.special = 2
)
GROUP BY
hlstats_Ribbons.awardCode
hlstats_Ribbons.awardCode,
hlstats_Ribbons.image
");
$res = $db->query
("
Expand Down
4 changes: 3 additions & 1 deletion web/pages/playerinfo_teams.php
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,9 @@
)
AND hlstats_Roles.game = '$game'
GROUP BY
hlstats_Events_ChangeRole.role
hlstats_Events_ChangeRole.role,
hlstats_Frags_as_res.killsTotal,
hlstats_Frags_as_res.deathsTotal
ORDER BY
$tblRoles->sort $tblRoles->sortorder,
$tblRoles->sort2 $tblRoles->sortorder
Expand Down
3 changes: 2 additions & 1 deletion web/pages/playerinfo_weapons.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@
OR hlstats_Weapons.weaponId IS NULL
)
GROUP BY
hlstats_Events_Frags.weapon
hlstats_Events_Frags.weapon,
hlstats_Weapons.modifier
ORDER BY
$tblWeapons->sort $tblWeapons->sortorder,
$tblWeapons->sort2 $tblWeapons->sortorder
Expand Down
6 changes: 4 additions & 2 deletions web/pages/ribboninfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@
GROUP BY
flag,
lastName,
hlstats_Players.playerId
hlstats_Players.playerId,
hlstats_Awards.name
HAVING
COUNT(hlstats_Awards.name) >= $awardmin
ORDER BY
Expand Down Expand Up @@ -174,7 +175,8 @@
GROUP BY
flag,
lastName,
hlstats_Players.playerId
hlstats_Players.playerId,
hlstats_Awards.name
HAVING
COUNT(hlstats_Awards.name) >= $awardmin
");
Expand Down

0 comments on commit 7eaef1a

Please sign in to comment.