title: PHP If else statement that a database record is empty it will display a default picture
body: <p>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.</p>
  
  <p>Cheers.</p>
  
  <p>Code so far:</p>
  
  <pre><code>//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 ))
  {
  ?&gt;
  
          &lt;div class="member"&gt;
          &lt;div class="imageSection"&gt;
         &lt;? 
  
          if($info['photo'] == '')
           {echo "&lt;img class=\"memberImage\" src=images/default.jpg&gt;";}
            else {echo "&lt;img class=\"memberImage\" src=images/".$info['photo'] ."&gt;";}
           ?&gt;
          &lt;/div&gt;  
          &lt;div class="memberInfo"&gt;
  &lt;? Echo "&lt;p&gt;&lt;strong&gt;Name: ".$info['nameMember'] . "&lt;/strong&gt;&lt;/p&gt;";
  Echo "&lt;p&gt;Position: ".$info['bandMember'] . " &lt;/p&gt;";
  Echo "&lt;p&gt;About Band Member ".$info['nameMember'] .":".$info['aboutMember'] . "&lt;/p&gt;";
  Echo "&lt;p&gt;Other Bands: ".$info['otherBands'] . " &lt;/p&gt;&lt;br/&gt;&lt;/div&gt;&lt;/div&gt;&lt;br class=\"clearBoth\"/&gt;";
  
  }
  ?&gt;
  </code></pre>