I am having a strange issue.
Once connected to the database, I can return only one column of values (the FG-PCT column).
Here is my query:
$query = "SELECT sstorm_players.player_LastName AS 'Full Name',
sum(sstorm_rawstats1.stats1_GP) AS 'GP',
sstorm_players.player_PlayerID AS 'PlayerID',
sstorm_players.player_Current AS 'Current',
sstorm_players.player_YEAR2011_12 AS '2011-12',
Sum(sstorm_rawstats1.stats1_FGM) AS 'FGM',
Sum(sstorm_rawstats1.stats1_FGA) AS 'FGA',
ROUND((sum(sstorm_rawstats1.stats1_FGM) / sum(sstorm_rawstats1.stats1_FGA)*100),1 AS 'FG-PCT'
FROM sstorm_players INNER JOIN sstorm_rawstats1
ON sstorm_players.player_PlayerID = sstorm_rawstats1.stats1_PlayerID
WHERE sstorm_players.player_PlayerID = sstorm_rawstats1.stats1_PlayerID
GROUP BY sstorm_players.player_PlayerID
HAVING sstorm_players.player_YEAR2011_12 = true
order by ROUND((sum(sstorm_rawstats1.stats1_FGM) / sum(sstorm_rawstats1.stats1_FGA)*100),1) desc";
When I echo the selected values, I can only return one of the columns (the FC-PCT column).
Here is an example of my echo statements:
// this statement has values that do not get returned
echo "<td align='center' bgcolor='$row_color'><strong>" . $row['FGM)'] . "</strong></td>";
// this statement has values that do not get returned
echo "<td align='center' bgcolor='$row_color'><strong>" . $row['FGA)'] . "</strong></td>";
// this statement has values that get returned
echo "<td align='center' bgcolor='$row_color'><strong>" . $row['FG-PCT'] . "</strong></td>";
I am not echoing all of the columns in my query.
Any help would be much appreciated.
Thank you,
Ken
You have a right paren in your array key which is why it can’t access the values:
$row['FGM)']should be$row['FGM']and$row['FGA)']should be$row['FGA']