Incrementando um select
Eaw galera tudo bem! Eu estou precisando muito de uma ajuda de vocês!
É o seguinte eu estou buscando noticias do banco de dados e dai eu queria que quando não tivesse noticia no banco de dados ele mostra uma mensagem aonde iria aparecer a noticia escrito
OPS NÃO TEMOS NENHUMA NOTICIA NO MOMENTO :(
Esta aqui em baixo o codigo atual que eu estou usando:
<?php
include "conexao.php";
$sql = mysql_query ("SELECT * FROM noticias LIMIT 3");
while ($exibe = mysql_fetch_assoc($sql)){
?>
<table width="500" border="0" cellspacing="0" cellpadding="0">
<tr>
<th width="500" height="30" bgcolor="#333333" scope="col">Autor: <?php echo $exibe['autor']; ?></th>
</tr>
<tr>
<th width="500" height="100" bgcolor="#666666" scope="col"><?php echo $exibe['noticia']; ?></th>
</tr>
<tr>
<th width="500" height="30" bgcolor="#333333" scope="col">Criado em: <?php echo $exibe['data']; ?></th>
</tr>
<tr>
<th width="500" height="30" scope="col"> </th>
</tr>
</table>
<?php } ?>
Como eu faço pra aparecer a mensagem OPS NÃO TEMOS NENHUMA NOTICIA NO MOMENTO :( quando não tiver noticias?
VAI ESTAR ME AJUDANDO MUITOOOOOOO S2
Discussão (7)
Carregando comentários...