我有 2 个while
循环,一个在另一个循环中。
所以
while ($info5 = mysql_fetch_array($result5))
{
print "</td>";
然后我有这个 sql 查询
include('database.inc');
$sql6 = "SELECT count(checkins.placeID) as methoda FROM checkins, places, activities WHERE activities.actID=places.placeActivity AND checkins.placeID = places.placeID and checkins.cityID = ".$city." group by checkins.placeID order by checkins.placeID, activityName";
$result6=mysql_query($sql6);
$count=mysql_num_rows($result6);
while($row = mysql_fetch_array($result6))
{
echo $row["methoda"];
}
print "</td></tr></table>" ;
}?>
问题是我收到 1 个表,例如:
Place1 -> 321
Place2 -> 321
Place3 -> 321
顺序是正确的,但我将它作为数组接收!正确的应该是
Place1 -> 3
Place2 -> 2
Place3 -> 1
我不知道如何拆分数组$row
,或者是转置问题,还是count命令已经堆叠等等。我真的不知道!请帮我。