Not showing nulls.....HELP
Posted: Thu Oct 02, 2003 7:34 am
I am quering a MySQL db, for contact information, and some of the fields are NULL allowed. How do I not pull the NULL info to the web page (a empty line on the web page)? For example, some entries do not have an Address 2.
Here is my code:
Here is my code:
Code: Select all
<?php
function display_physicians_details($physicians)
{
// display all details about this physician
if (is_array($physicians))
{
echo '<table><tr>';
//display the picture if there is one
if (@file_exists('images/'.($physicians['last_name']).'.jpg'))
{
$size = GetImageSize('images/'.$physicians['last_name'].'.jpg');
if($size[0]>0 && $size[1]>0)
echo '<td><img src=''images/'.$physicians['last_name'].'.jpg'' border=0 '.$size[1].'></td>';
}
echo '<td>';
echo '<H2>';
echo $physicians['title'];
echo '.<b></b> ';
echo $physicians['first_name'];
echo '<b></b> ';
echo $physicians['last_name'];
echo '<b></b></H2> ';
echo '<b></b> ';
echo $physicians['specialty_ID'];
echo '<br><b></b><br> ';
echo $physicians['address'];
echo '<b></b> ';
echo $physicians['address2'];
echo '<br><b></b> ';
echo $physicians['city'];
echo '<b></b> ';
echo $physicians['state'];
echo '<b></b> ';
echo $physicians['zip'];
echo '<br>Phone: ';
echo $physicians['telephone'];
echo '<br>Fax: ';
echo $physicians['fax'];
echo '<br><br><b>Medical Degree School</b><br> ';
echo $physicians['school_attended'];
echo '<br><br><b>Board Certified</b><br> ';
echo $physicians['board_certification_ID'];
echo '</td></tr></table>';
}
else
echo 'The details of this Physician cannot be displayed at this time.';
echo '<br>';
}