Hi
I have been search and looking for help with this one. What I'm trying to do is if an image was found then display it and if no image was found then display the default blank image. The code below will display the image if one is found but will not display the blank image in nothing is found
any help is excellent
/Gets buddies photo from thge table images if one exsists
$query_get_photo = ("SELECT * FROM `image_files` WHERE `user_id` = '$buddy_id' AND `album` = 'Member'");
$get_photo = mysql_query($query_get_photo)or die("SQL Error: $query_get_photo <br>" . mysql_error());
while($photo = mysql_fetch_assoc($get_photo)){
if (!empty($photo['image_name'])){
$imageName = $photo['image_name'];
}
elseif(empty($photo['image_name'])){
$imageName = 'blankAlbum.jpg';
$newwidth=75;
$newheight=100;
}
$photoCount = mysql_num_rows($get_photo);
echo $photoCount;
if($photoCount > 0){
$image = "user_images/".$photo['image_name'];
$tempimg = getImageSize($image);
$size = $tempimg[3];
$size = explode("\"",$size);
$width = $size[1];
$height = $size[3];
$newwidth=75;
$newheight=($height/$width)*75;
}
?>
<a href="profile.php?id=<?php echo $buddy_id; ?>"><img src="user_images/<?php echo $imageName ;?>"width="<?php echo $newwidth; ?>" height="<?php echo $newheight?>" alt="<?php echo $imageName;?>" /></a>
<?php }
?>