Eu testei. O concerto da escrita deu certo, porém, ele não mostra nem a página e nenhum resultado, ele mostra só o conteúdo dizendo ´"nenhuma última notícia" if (@mysql_num_rows($resultado2) == 0) die ("Nenhuma última notícia!"); Se eu possuo no banco de dados por exemplo duas notícias da seção 2 ele ainda mostra esse erro. Vou postar o código completo da página. <?php require_once('Connections/conrecadinhos.php'); ?>
<?php
//Consulta para o leitor
$sql = "SELECT * FROM noticias WHERE id=".$_GET['id']." AND not_status = '1' ";
$resultado = mysql_query($sql) or die ("Não foi possível realizar consulta!");
if (@mysql_num_rows($resultado) == 0) die ("Nenhum registro encontrado!");
$linha=mysql_fetch_array($resultado);
// Consulta para o ùltimas notícias A PARTIR DE SECAO DEFINIDA VIA URL
//$sql2 = "SELECT * FROM noticias WHERE not_status = '1' ORDER BY id DESC LIMIT 5";
$sql2 = "SELECT not_titulo,not_data,not_secao FROM noticias WHERE not_status = '1' AND '".$_GET['not_secao']."' ORDER BY id DESC LIMIT 5";
$resultado2 = mysql_query($sql2) or die (mysql_error());
if (@mysql_num_rows($resultado2) == 0) die ("Nenhuma última notícia!");
?>
<html>
<head>
<title>::: <?php echo $linha['not_titulo']; ?> :::</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="keywords" content="keyword1, keyword2, keyword3">
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
background-image: url(imagens/bgpaginas.gif);
margin-bottom: 0px;
}
-->
</style>
<link href="css/cnsgestilos.css" rel="stylesheet" type="text/css">
<link href="ferramentas_css/noticias.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {color: #FFFFFF}
-->
</style>
</head>
<body bgcolor="#ffffff">
<table border="0" cellpadding="0" cellspacing="0" width="811">
<!--DWLayoutTable-->
<tr>
<td height="216" colspan="3" valign="top" bgcolor="#FFCC00"><?php include('menu_top.php'); ?></td>
<td width="8" rowspan="3" valign="top" background="imagens/smb_princi.gif"><img src="imagens/smb_princi.gif" width="8" height="8"></td>
</tr>
<tr>
<td width="616" height="509" valign="top"><table width="100%" height="100%" border="0" cellpadding="0" background="imagens/bg_principal.jpg" cellspacing="0" bgcolor="#993300">
<!--DWLayoutTable-->
<tr>
<td width="616" height="100%" valign="top"><div align="center">
<p>
<?php include('topo_img.php'); ?><span class="nottitulo"><strong><?php echo $linha['not_titulo']; ?></strong></span></p>
<p align="right"><span class="notdata">Publicado em:
<?php $linha['not_data'] ?>
<?php echo date('d/m/Y', strtotime($linha['not_data'])); ?></span></p>
<blockquote>
<p align="justify" ><span class="nottexto"><?php echo nl2br($linha['not_texto']); ?></span></p>
</blockquote>
<p align="center" class="nottexto"> </p>
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFCC">
<tr>
<td bgcolor="#003399"><div align="center"><span class="nottexto style1"><strong>Últimas Notícias - Geral</strong></span></div></td>
</tr>
<tr>
<td><ul class="seta">
<div align="left"><span class="nottexto">
<?php while ($linha2 = mysql_fetch_array($resultado2)) { ?>
</span></div>
<li class="nottexto">
<div align="left"><a href="not_leitor.php?id=<?php echo $linha2['id']; ?>&secao=<?php echo $linha2['not_secao']; ?>" class="linkazul">
<?php $linha2['not_data'] ?>
<?php echo date('d/m/Y', strtotime($linha2['not_data'])); ?> - <?php echo $linha2['not_titulo']; ?></a><?php } ?></div>
</li>
</span></ul></td>
</tr>
</table>
<p>
<p align="left" class="textoint"><a href="java script:history.back()"><img src="imagens/voltar.gif" width="25" height="25" border="0" align="left"></a><a href="index.asp" class="linkint">VOLTAR</a> </p>
</div></td>
</tr>
</table></td>
<td width="4" valign="top"><img src="imagens/espaco_branco.gif" width="4" height="4"></td>
<td width="183" valign="top" bgcolor="#003399"><?php include('lateral-dir.php'); ?></td>
</tr>
<tr>
<td height="45" colspan="3" valign="top" background="imagens/bg_fimsite.gif"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="798" height="45" valign="middle"><div align="center" class="textobuscasite">Melhor visualizado em 1024x768<br>
Copyright©2003 Colégio Nossa Senhora das Graças. Todos os direitos reservados.</div></td>
<td width="5" valign="top"><img src="imagens/bg_fimsite.gif" width="2" height="45"></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
<?php
mysql_free_result($resultado);
mysql_free_result($resultado2);
?> Obrigado pela compreensão!