title: Display if exist image from mysql with PHP
body: <p>I setup a comment form with the option to submit an image, I want now to display the image only if exist.</p>
  
  <p>This is the php script that I have, I know it should be related to an "if" statement but I don't know how to do it</p>
  
  <p>Any help would be appreciated</p>
  
  <pre><code>&lt;?php
  $dbLink = mysql_connect("xxx","xxx","xxx");
  mysql_query("SET character_set_results=utf8", $dbLink);
  mb_language('uni');
  mb_internal_encoding('UTF-8');
  
  $getquery=mysql_query("SELECT * FROM comment ORDER BY id DESC");
  
  while($rows=mysql_fetch_assoc($getquery)) {
      $id=$rows['id'];
      $name=$rows['name'];
      $comment=$rows['comment'];
      echo '&lt;b&gt;' . $name . '&lt;/b&gt;' . '&lt;br/&gt;' . '&lt;br/&gt;' . $comment . '&lt;br/&gt;' . '&lt;br/&gt;' . '&lt;img src="data:image/jpeg;base64,'.base64_encode($rows['imageData'] ).'"/&gt;' . '&lt;br/&gt;' . '&lt;br/&gt;' . '&lt;hr size="1"/&gt;';
  }
  ?&gt;
  </code></pre>