1
Hi, I have a news system and wanted a message to appear when there was no news in my database.
Code:
<?php
$news8 = mysql_query("SELECT * FROM 10cms_noticias WHERE status = 'Ativo' ORDER BY ID DESC LIMIT 8") or die(mysql_error());
?>
<?php $i = 0; while($noticias = mysql_fetch_assoc($news8)){ $i++; ?>
<div class='noticia'>
<div class='img' style='background-image: url(<?php echo $noticias['img']; ?>);'></div>
<div class='titulo'><?php echo'<a href="./noticias/'.$noticias['id'].'">';?><b><?php echo $noticias['titulo']; ?></b></div>
<div class='desc'><?php echo $noticias['resumo']; ?></a></div>
<div class='info'>
<div class='comentarios' title="20 Comentários"></div>
<div class='data' title="<?php echo $noticias['data']; ?>"></div>
<div class='autor' title="<?php echo $noticias['autor']; ?>" style='background-image: url(https://www.habbo.com.br/habbo-imaging/avatarimage?img_format=gif&user=<?php echo $noticias['autor']; ?>&action=std&direction=2&head_direction=3&gesture=std&size=s);'></div>
</div>
</div>
<?php } ?>
Did my answer work? If so, please accept it.
– Sr. André Baill