我正在尝试获取每一行的结果并一次打印出一个,以便我最终可以将它们放在自己的特定变量中,但它不起作用。谁能看到我做错了什么?它只是进入打印第一行的无限循环。我知道总共有 4 行。
$scores_query = mysql_query("SELECT Day, Time, AM_PM,
Away,
case when Away_Score is null then '@' else Away_Score end as Away_Score,
Home,
case when Home_Score is null then '' else Home_Score end as Home_Score
FROM `NFL_Games` WHERE Week=6
order by
(case Day
when 'Thu' then 1
when 'Sat' then 2
when 'Sun' then 3
when 'Mon' then 4
else 5 end),
Day, Time ASC");
$count = mysql_num_rows($scores_query);
echo "Hellloooo" . $count;
while($results = mysql_fetch_array($scores_query)) {
for($x = 1; $x <= $count; $x++) {
/*echo $results['Day'] . "__" . $results['Time'] . "__" . $results['AM_PM'] . "__" . $results['Away'] . "__" . $results['Away_Score'] . "__" . $results['Home'] . "__" . $results['Home_Score'];
echo "<br/>";*/
/*echo (Day, Time, AM_PM, Away, Away_Score, Home, Home_Score);*/
if ($x = 1) {
echo $results['Day'] . "__" . $results['Time'] . "__" . $results['AM_PM'] . "__" . $results['Away'] . "__" . $results['Away_Score'] . "__" . $results['Home'] . "__" . $results['Home_Score'];
echo "<br/>";
} else if ($x = 2) {
echo $results['Day'] . "__" . $results['Time'] . "__" . $results['AM_PM'] . "__" . $results['Away'] . "__" . $results['Away_Score'] . "__" . $results['Home'] . "__" . $results['Home_Score'];
echo "<br/>";
} else if ($x = 3) {
echo $results['Day'] . "__" . $results['Time'] . "__" . $results['AM_PM'] . "__" . $results['Away'] . "__" . $results['Away_Score'] . "__" . $results['Home'] . "__" . $results['Home_Score'];
echo "<br/>";
} else if ($x = 4) {
echo $results['Day'] . "__" . $results['Time'] . "__" . $results['AM_PM'] . "__" . $results['Away'] . "__" . $results['Away_Score'] . "__" . $results['Home'] . "__" . $results['Home_Score'];
echo "<br/>";
} else {
break;
}
}
}