fiz um sistema de noticia... e fiz um esquema de colocar a noticia em destaque a que tiver imagem
o problema é:
quando eu adiciona o 2º noticia com imagem ai fica 2 noticia com imagem, só que eu queria que quando adiocionasse a 2º noticia com imagem a outra antiga tinha que sair e não está dando certo.
<?php
$sql_noticia = "SELECT * FROM noticia ORDER BY id_noticia DESC LIMIT 10" or die(mysql_error());
$exe_noticia = mysql_query($sql_noticia);
$num_noticia = mysql_num_rows($exe_noticia);
while($i = mysql_fetch_array($exe_noticia,MYSQL_ASSOC)){
$id_noticia = $i['id_noticia'];
$titulo_noticia = $i['titulo_noticia'];
$titulo = stripcslashes($titulo_noticia);
$id_categoria = $i['id_categoria'];
$hora_noticia = $i['hora_noticia'];
$data_noticia = $i['data_noticia'];
$img_noticia = $i['img_noticia'];
if($img_noticia == true){
echo"<table width='100%' border='0' cellspacing='2' cellpadding='0'>
<tr>
<td width='3%'><div align='left'><a href='?tpl=noticia&id_noticia=$id_noticia'><img src='$img_noticia' border='0' alt='$titulo_noticia'/></a></div></td>
<td width='97%' valign='top'><div align='left'><a href='?tpl=noticia&id_noticia=$id_noticia'><span class='data_noticia'>[$data_noticia]</span><br><span class='titulo_form'>$titulo_noticia</span></a></div></td>
</tr>
</table>";
}else{
echo"<div align='left'><a href='?tpl=noticia&id_noticia=$id_noticia'><img src='img/seta-azul.gif' border='0' />$titulo</a></div><table width='100px' height='0' border='0' align='center' cellpadding='0' cellspacing='0'>
<tr>
<td><img src='img/x-c.jpg' width='4' height='4'></td>
</tr>
</table>";
}
}
?>










