summaryrefslogtreecommitdiff
path: root/html/pages/home.php
diff options
context:
space:
mode:
authorMatthijs Kuiper <info@matthijskuiper.nl>2017-02-12 20:30:01 +0100
committerGitHub <noreply@github.com>2017-02-12 20:30:01 +0100
commit66b162b5f01c996fd8a5cd4e570e31f8483cdffa (patch)
treedf404d4d8e26db5e564aece272c64896c38ce0f6 /html/pages/home.php
parent07b6b55355dc0555cf578067ff38e9e52c03fe7e (diff)
parent7abeb203d8b6d537a55b0dd9a1ccac32e6f948ec (diff)
Merge pull request #3 from sn3p/sn3p/fix-mysql-group-by-errors4.2.9
Fix MySQL ONLY_FULL_GROUP_BY errors
Diffstat (limited to 'html/pages/home.php')
-rwxr-xr-xhtml/pages/home.php13
1 files changed, 9 insertions, 4 deletions
diff --git a/html/pages/home.php b/html/pages/home.php
index 3cb167d..be75b66 100755
--- a/html/pages/home.php
+++ b/html/pages/home.php
@@ -57,10 +57,14 @@ echo'
</tr>';
$sql_gamesummary = "SELECT g.id AS gid, g.name AS gamename, SUM(p.frags) AS frags, SUM(p.kills) AS kills, SUM(p.suicides) AS suicides, SUM(p.teamkills) AS teamkills, COUNT(DISTINCT p.matchid) AS matchcount
-FROM uts_player AS p, uts_games AS g WHERE p.gid = g.id GROUP BY gamename ORDER BY gamename ASC";
+FROM uts_player AS p, uts_games AS g
+WHERE p.gid = g.id
+GROUP BY gamename, gid
+ORDER BY gamename ASC";
+
$q_gamesummary = mysql_query($sql_gamesummary) or die(mysql_error());
-while ($r_gamesummary = mysql_fetch_array($q_gamesummary)) {
+while ($r_gamesummary = mysql_fetch_array($q_gamesummary)) {
$gid = $r_gamesummary[gid];
$q_gametime = small_query("SELECT SUM(gametime) AS gametime FROM uts_match WHERE gid = '$gid'");
@@ -76,7 +80,8 @@ while ($r_gamesummary = mysql_fetch_array($q_gamesummary)) {
}
$totalsummary = small_query("SELECT SUM(p.frags) AS frags, SUM(p.kills) AS kills, SUM(p.suicides) AS suicides, SUM(p.teamkills) AS teamkills, COUNT(DISTINCT p.matchid) AS matchcount, SUM(p.gametime) AS gametime
-FROM uts_player AS p, uts_games AS g WHERE p.gid = g.id");
+FROM uts_player AS p, uts_games AS g
+WHERE p.gid = g.id");
$q_gametime = small_query("SELECT SUM(gametime) AS gametime FROM uts_match");
$gametime = sec2hour($q_gametime[gametime]);
@@ -97,4 +102,4 @@ echo' <tr>
$gtitle = "Across All Servers";
$bgwhere = "id >= 0";
include("pages/graph_mbreakdown.php");
-?> \ No newline at end of file
+?>