This is my code:
$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/>
<?
}
The problem is that it is only displaying the last record in the table when I echo $grid1 or $grid2 rather than all of them.
Please can anyone help?