$date['"01.06.2012"'] = '2012-06-01';
$date['"01.05.2012"'] = '2012-05-01';
$date['"01.04.2012"'] = '2012-04-01';
$date['"01.03.2012"'] = '2012-03-01';
$date['"01.02.2012"'] = '2012-02-01';
$date['"01.01.2012"'] = '2012-01-01';
foreach($date as $month => $actual_date)
{ /* start foreach loop */
$query = "select Player, SUM(points) AS score from rankings WHERE
`drop_date` > '$actual_date'
AND `drop_date` <= DATE_ADD('$actual_date', INTERVAL 1 YEAR)
GROUP BY Player
ORDER BY SUM(sa_points) LIMIT 0,5";
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($result)){
echo $row['player'];
echo $row['score']; }
} /* end foreach loop */
现在我只想向这个结果表添加另一个查询,我已经尝试过create temporary table
但不知道根据 foreach 循环将它放在哪里,并且不断得到解析错误或最后的$actual_date
结果。