<?
mysql_connect("$dbhost", "$dbuser", "$dbpass") or die ("Unable to connect to database.");
mysql_select_db("$dbname") or die ("Cannot select database.");
$sqlquery = "SELECT * FROM Customers WHERE Status = 1 OR Status = 2 OR Status = 3";
$result = mysql_query($sqlquery);
$number = mysql_num_rows($result);
$i=0;
if ($number < 1)
{
echo "<center>No results found.</center>.";
}
else
{
while ($number > $i)
{
$id = mysql_result($result,$i,"CustID");
$status = mysql_result($result,$i,"Status");
$firstname = mysql_result($result,$i,"FirstName");
$lastname = mysql_result($result,$i,"LastName");
$phone1 = mysql_result($result,$i,"Phone1");
$city = mysql_result($result,$i,"City");
$state = mysql_result($result,$i,"State");
$zip = mysql_result($result,$i,"Zip");
echo "<tr>
<td><a href=\"viewcustomer.php?id=$id\"><img src=\"../images/tick.png\" /></a></td>
<td>$status</td>
<td>$firstname</td>
<td>$lastname</td>
<td>$phone1</td>
<td>$city</td>
<td>$state</td>
<td>$zip</td>
</tr>";
$i++;
}
}
?>