我有一个奇怪的问题。
一旦连接到数据库,我只能返回一列值(FG-PCT 列)。
这是我的查询:
$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";
当我回显所选值时,我只能返回其中一列(FC-PCT 列)。
这是我的回声语句的示例:
// 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>";
我没有回显查询中的所有列。
任何帮助将非常感激。
谢谢,
肯