I am pulling a query out of the database and printing the results in html- However, if one of the fields for the table is NULL I end up with a blank line in my results. How do I avoid that?
For example:
$row = mysql_fetch_array($query);
{
$business = $row["business"];
$contact = $row["contact"];
$address1 = $row["address1"];
$address2 = $row["address2"];
$city = $row["city"];
$state = $row["state"];
$zip = $row["zip"];
$phone = $row["phone"];
$email = $row["email"];
print ("<B>$business</B><BR> \n");
print ("$contact<BR> \n");
print ("$address1<BR> \n");
print ("$address2<BR> \n");
print ("$city $state $zip<BR> \n");
print ("$phone<BR> \n");
print ("$email<BR> \n");
}
If the address2 field is NULL Print returns a blank line-
Please help
Thanks
BK
For example:
$row = mysql_fetch_array($query);
{
$business = $row["business"];
$contact = $row["contact"];
$address1 = $row["address1"];
$address2 = $row["address2"];
$city = $row["city"];
$state = $row["state"];
$zip = $row["zip"];
$phone = $row["phone"];
$email = $row["email"];
print ("<B>$business</B><BR> \n");
print ("$contact<BR> \n");
print ("$address1<BR> \n");
print ("$address2<BR> \n");
print ("$city $state $zip<BR> \n");
print ("$phone<BR> \n");
print ("$email<BR> \n");
}
If the address2 field is NULL Print returns a blank line-
Please help
Thanks
BK