title: PHP: How to display a default Image if the specified one doesn't exists?
body: <p>I am working on a little project and I need to display the author's image for each author in my database. peep the code below:</p>
  
  <p><strong>--THE QUERY--</strong></p>
  
  <pre><code>$getboth_sql = mysql_query(
  
  "SELECT lyrics.lyrics_id, lyrics.lyrics_title, lyrics.lyrics_text,artists.artist_nane,artists.artist_id
  FROM lyrics,artists
  WHERE lyrics.artist_id = artists.artist_id
  ORDER BY lyrics.lyrics_title");
  
  while ($both = mysql_fetch_assoc($getboth_sql)) {
  
      $lyrics_id = $both[lyrics_id];
      $lyrics_title = $both[lyrics_title];
      $lyrics_text = $both[lyrics_text];
      $artist_name = $both[artist_nane];
      $artist_id = $both[artist_id];
  
      ?&gt;
      &lt;div class="artimg"&gt;&lt;img src="images/artists/&lt;?php echo $artist_name;?&gt;.jpg"  height="50px" width="50px"/&gt;&lt;/div&gt;        
  
  
  
      &lt;?php
  }//END While
  </code></pre>
  
  <p>The above code work but if I have not saved an image in the 'artists' directory no image show up for that artist.</p>
  
  <pre><code>&lt;div class="artimg"&gt;&lt;img src="images/artists/&lt;?php echo $artist_name;?&gt;.jpg"  height="50px" width="50px"/&gt;&lt;/div&gt;
  </code></pre>
  
  <p>QUESTION: What is the BEST way to display a default image if the specified on is not found.</p>
  
  <p>I have been playing around with the empty and file exists functions but i haven't gotten it right. Please Help. </p>
  
  <p>PS I'm not a pro if this question seems stupid!</p>