Ok I have this working But it is not repeating for each game. This is only displaying the first game. I need it to repeat and show sum of all totals for each game.
stats table looks something like this
I need it to show total of all unique gid repeated on one line for each game.
id | pid | gid | pts | thr | orb | drb | ast | etc.
1---10---1----19---2----2----3----3----etc.
2---5----1----9----0----1----1----1----etc.
3---7----1----5----1----0----2----6----etc.
4---10---2----12---1----2----4----2----etc.
<?php
mysql_select_db($database_Connection, $Connection);
$sql = "SELECT pid, SUM(pts) AS Sum_pts FROM stats GROUP BY gid";
$result = mysql_query($sql) or die(mysql_error());
$i = mysql_fetch_array($result);
?>
<?php echo $i['Sum_pts'];?>
Also this is only show pts I need it to show all stats.
I need select sum from stats group by gid
something like that.
Thankyou for any help.
Or something like this:
<?php
mysql_select_db($database_Connection, $Connection);
$query_statz = "SELECT * SUM(gid) FROM stats Group By gid";
$statz = mysql_query($query_statz, $Connection) or die(mysql_error());
$row_statz = mysql_fetch_assoc($statz);
$totalRows_statz = mysql_num_rows($statz);
?>
This to display results like this
<?php echo $row_statz['Pts']; ?>
<?php echo $row_statz['FG']; ?>
ETC....