rocknbil - 12:40 am on Jul 13, 2010 (gmt 0)
Well, there's a more encompassing solution. What if, for whatever reason, the actual file gets deleted but it's still in the db? If you just check for the file existence, you don't need to worry about empty or null.
$no_img = '/images/no-image.jpg'; // URL to your default image
Store whatever's in DB in $img in your while loop, then
$display_img = (is_file("/full_path_to/$img"))?"/customer_images/$img":$no_img;
<img src="$display_img" alt="$display_img">
Should really use GD/ImageMagick and add the width/height of the image, but not "required."