I made the code to show only if it has image, but it also shows the body of the empty, it says in the source code of the page that my PHP is a comment as shown in the image below.
Andthecodeisthis:
HowdoInotshowtheemptyphotosthewayyouarehere?
echo'<php$seleciona=mysqli_query($conexao,"SELECT * FROM postagem where status=1 ORDER BY id desc");
while($campo=mysqli_fetch_array($seleciona)){
$nome_imagem = $campo["nome_imagem"];
?>
<center>
<div id="panel" align="left">
<label class="titulo"> '. $result1[$i][1] . '</label><br>
<p class="descricao">'. $result1[$i][2] . '</p><br>
<?php if ($nome_imagem != null){?><p><img src="foto/'. $result1[$i][3] . '" class="foto"></p><?php } ?>
<span class="glyphicon glyphicon-user" aria-hidden="true"></span> Postado por: '. $result1[$i][6] . ' em '. $result1[$i][4] . ' às '. $result1[$i][5] . '</td>
<a href="0_excluir_postagem.php?editaid='. $result1[$i][0] . '"><span class="glyphicon glyphicon-trash"></span></a>
</div></center>
<?php }?>
</div>' ;
}