Hi basicly I am trying to create a simple IF statement that shows a default picture if one hasn't been entered in to my database. I am using server to store my picture and a database to store the file name, so I can get the image to display if it has a file name in the db but I want the If statement to say if the record is empty display this default image. I have some code here that I have tried however it doesn't work any thoughts? I tried a few other ways of doing it but they didn't work either.
Cheers.
Code so far:
//Retrieves data from MySQL
$data = mysql_query("SELECT * FROM db*****") or die(mysql_error());
//Puts it into an array
while($info = mysql_fetch_array( $data ))
{
?>
<div class="member">
<div class="imageSection">
<?
if($info['photo'] == '')
{echo "<img class=\"memberImage\" src=images/default.jpg>";}
else {echo "<img class=\"memberImage\" src=images/".$info['photo'] .">";}
?>
</div>
<div class="memberInfo">
<? Echo "<p><strong>Name: ".$info['nameMember'] . "</strong></p>";
Echo "<p>Position: ".$info['bandMember'] . " </p>";
Echo "<p>About Band Member ".$info['nameMember'] .":".$info['aboutMember'] . "</p>";
Echo "<p>Other Bands: ".$info['otherBands'] . " </p><br/></div></div><br class=\"clearBoth\"/>";
}
?>