<?php if ($totalRows_cont > 0) { // Show if recordset not empty ?> <img src="<?php echo $row_cont['img']; ?>" border="0" class="upload_img" /> <?php } // Show if recordset not empty ?>