Good Morning,
I am writing code for a Hockey Pool site and I am working on the Standings page...typical divisional standings page.
My code runs through a loop for the four teams in each division and yields results for each team and outputs fine. Here is my problem...I want to sum the sums of the four teams.
For example, with Games Played it calculates the total GP for each team with the following chunk of code.
// GP
echo "</td><td width='40'align='center' bgcolor='FFFFFF'><font face='arial' size='2' color='000000'>";
$ttl_GP=$row['GP_wk1']+$row['GP_wk2']+$row['GP_wk3']+$row['GP_wk4']+$row['GP_wk5']+$row['GP_wk6']+$row['GP_wk7']+$row['GP_wk8']+$row['GP_wk9']+$row['GP_wk10']+$row['GP_wk11']+$row['GP_wk12']+$row['GP_wk13']+$row['GP_wk14']+$row['GP_wk15']+$row['GP_wk16']+$row['GP_wk17']+$row['GP_wk18']+$row['GP_wk19']+$row['GP_wk20']+$row['GP_wk21']+$row['GP_wk22']+$row['GP_wk23']+$row['GP_wk24']+$row['GP_wk25']+$row['GP_wk26'];
echo $ttl_GP;
This outputs a result of Team 1 - 57, Team 2 - 57, Team 3 - 58, Team 4 - 60.
I would now like to be able to sum these in final row to yield a result of 232.
Here is what I have tried but it echos "0". I think my syntax may be off.
$div_GP=$ttl_GP[$row['Team']]+$ttl_GP[$row['Team']]+$ttl_GP[$row['Team']]+$ttl_GP[$row['Team']];
Any help would be appreciated.