dongyin2643 2013-12-31 06:39
浏览 26

用PHP汇总列

I am trying to get my totals to sum into columns. Right now I have it set up to add up totals like goals and assists but they print to the right of my current row.

I am trying to get it to print at the bottom row in its own row all together so it will look something like this: http://www.nhl.com/ice/player.htm?id=8477290 for the career statistics.

Right now it looks like this http://cnghl.biz/cnghldb/cnghlplayerinfo.php?PlayerID=1267

$oPlayerStats = mysql_query("

SELECT SeasonStats.Sea, SeasonStats.TeamID, SeasonStats.GP, SeasonStats.Goals,
SeasonStats.Assists, SeasonStats.Points, SeasonStats.PlusMinus,
SeasonStats.Pim, SeasonStats.PP, SeasonStats.SH, SeasonStats.GW,
SeasonStats.GT, SeasonStats.S, Seasonteam.Team, SUM(SeasonStats.Goals) AS Goals_Total,                    SUM SUM (SeasonStats.Assists) AS Assists_Total, SUM(SeasonStats.Assists) As Games_Total
FROM SeasonStats
Left JOIN Seasonteam
On SeasonStats.TeamID=Seasonteam.TeamID
WHERE SeasonStats.PlayerID=$iPlayerID
ORDER BY SeasonStats.Sea;
") or die(mysql_error());

Print "<br><br><table border=1 cellpadding=1>";



Print "<tr>";
Print "<td><strong>Season</strong></td> ";
Print "<td><strong><center>Team</center></strong></td> ";
Print "<td><strong><center>GP</center></strong></td> ";
Print "<td><strong><center>G</center></td></strong> ";
Print "<td><strong><center>A</center></strong></td> ";
Print "<td><strong><center>P</center></strong></td> ";
Print "<td><strong><center>PIM</center></strong></td> ";
Print "<td><strong><center>+/-</center></strong></td> ";
Print "<td><strong><center>PPG</center></strong></td> ";
Print "<td><strong><center>SHG</center></strong></td> ";
Print "<td><strong><center>GWG</center></strong></td> ";
Print "<td><strong><center>GTG</center></strong></td> ";
Print "<td><strong><center>Shots</center></strong></td> ";
Print "<td><strong><center>Total Goals</center></strong></td> ";

while($row = mysql_fetch_array($oPlayerStats))
{
Print "<tr>";
Print "<td><center>".$row['Sea']."</center></td> ";
Print "<td><center>".$row['Team']."</center></td> ";
Print "<td><center>".$row['GP']."</center></td> ";
Print "<td><center>".$row['Goals']."</center></td> ";
Print "<td><center>".$row['Assists']."</center></td> ";
Print "<td><center>".$row['Points']."</center></td> ";
Print "<td><center>".$row['Pim']."</center></td> ";
Print "<td><center>".$row['PlusMinus']."</center></td> ";
Print "<td><center>".$row['PP']."</center></td> ";
Print "<td><center>".$row['SH']."</center></td> ";
Print "<td><center>".$row['GW']."</center></td> ";
Print "<td><center>".$row['GT']."</center></td> ";
Print "<td><center>".$row['S']."</center></td> ";
Print "<td><center>".$row['Goals_Total']."</center></td> ";
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 winform的chart曲线生成时有凸起
    • ¥15 msix packaging tool打包问题
    • ¥15 finalshell节点的搭建代码和那个端口代码教程
    • ¥15 用hfss做微带贴片阵列天线的时候分析设置有问题
    • ¥15 Centos / PETSc / PETGEM
    • ¥15 centos7.9 IPv6端口telnet和端口监控问题
    • ¥120 计算机网络的新校区组网设计
    • ¥20 完全没有学习过GAN,看了CSDN的一篇文章,里面有代码但是完全不知道如何操作
    • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
    • ¥20 海浪数据 南海地区海况数据,波浪数据