Hello all. I'm relatively new to PHP and was stuck with getting results using the SUM() function of SQL.
My db (MySQL) holds basketball stats. I want to have two HTML tables output on a query: one for single game stats and one holding a running total of stats. I'm having problems getting a running total table to output. Is there a way to ammend the following?
$sql = "
SELECT SUM(points), SUM(asssits), SUM(fg)
FROM $games
";
$result = @($sql,$connection) or die ("Couldn't execute query");
while ($row = mysql_fetch_array($result)) {
$points = $row['points'];
$assists = $row['assists'];
$fg = $row['fg'];
$display_block .= "
HTML....
}
I'm know I need an AS in my SQL, but I don't know where to put that in my PHP. Any help would be appreciated!
Lynda