这是我的代码:
$result = mysql_query ($query) or die (mysql_error());
$row = mysql_fetch_assoc($result);
while($row = mysql_fetch_array( $result )) {
$contactID=$row['contactID'];
$contactFamily =$row ['contactFamily'];
$Contact=$row ['Contact'];
$contactOwner =$row ['contactOwner'];
$Impact=$row ['Impact'];
$Probability =$row ['Probability'];
if ($row ['Impact']=="5" && $row['Probability']=="4")
{
$grid1= $row ['contactFamily']." ".$row ['Contact']." .$row['contactOwner'];
}
?>
<br/>
<?php
if ($row ['Impact']=="3" && $row['Probability']=="4")
{
$grid2= $row ['contactFamily']." ".$row ['Contact']." .$row['contactOwner'];
}
?>
<br/>
<?
}
问题是当我回显 $grid1 或 $grid2 而不是全部时,它只显示表中的最后一条记录。
请问有人可以帮忙吗?