Here is my code (I renamed field names for communication purposes)
$dbhandle = mysql_connect($hostname, $username, $password)
$selected = mysql_select_db("companies",$dbhandle)
or die("Could not select companies");
while ($row = @mysql_fetch_array($query))
{
$variable1=$row["Email"];
$variable2=$row["WEB"];
echo "<tr bgcolor="#dddddd"><td><center>";
echo $row["City"];
echo ($variable2 != '') ? "<a href="$variable2"></br> Website</a>" : '';
echo ($variable1 != '') ? "<a href="mailto:$variable1">Email</a>" : '';
echo ltrim($row[""], '0');
}?>