Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Estou montando um jornal online, mas estou com um pequeno probleminha... na minha pagina inicial tenho as últimas notícias, mas não é limitado o número da minhas notícias. Como faço para limita-las? Alguém poderia me dar uma ajudinha? Segue o código abaixa... é só me dizer onde tenho que alterar, que eu altero. desde já muitissimo obrigado!!!
<?php
$query4 = "select linkemp,imgbanner
from banners
where ativo ='1'
and controle ='1'
order by rand() limit 4";
$res4 = mysql_query($query4,$conec) or die(mysql_error());
while ($row4 = mysql_fetch_array($res4))
{
{
echo "<tr align = \"center\" bgcolor =\"#ffffff\"><td>";
echo "<a href = \"".$row4[0]. "\"><img src =\"./admin/".$row4[1]."\">";
echo "</td></tr>";
} //include("menu.php");
}
// include("banner.php");?>
</table></td>
</tr>
</table>
<br> <br></td>
<td width="421" align="center" valign="top">
<table>
<?php
$query5 = "select idedicao from edicao
where ativada ='1'
and controle ='1'";
$res5 = mysql_query($query5, $conec) or die(mysql_error());
$idedicao = mysql_result($res5,0);
$query6 = "select idnoticia, notcat,notitulo, notlead, notimg
from noticias
where notedi = '$idedicao'
and destaque ='1'
and ativa ='1'
and controle ='1'
order by rand() limit 1";
$res6 = mysql_query($query6,$conec) or die(mysql_error());
while ($row6 = mysql_fetch_array($res6))
{
if (!empty($row6[4]))
{
$aux = $row6[0];
echo "<tr align = \"center\"><td><b>";
echo strtoupper($row6[2]) ."</b></td></tr>";
echo "<tr align = \"center\" ><td>";
echo "<img src =\"./admin/".$row6[4] ."\" width=\"409\" height=\"300\" </td></tr>";
echo "<tr align = \"center\" ><td>" . $row6[3] . "</td></tr>";
echo "<tr align = \"left\"><td> </td></tr>";
echo "<tr align =\"right\"><td>";
echo "<a href=\"index2.php?page=".$row6[1]. "&nt=". $row6[0]. "\"><font color=#0099dd>Leia mais</font></a></td></tr>";
}
else
{
$aux = $row6[0];
echo "<tr align = \"center\"><td><b>";
echo strtoupper($row6[2]) ."</b></td></tr>";
echo "<tr align = \"center\" ><td>";
//echo "<div class=\"feature\"><img src =\"./admin/".$row6[4] ."\" width=\"300\" height=\"220\">";
echo "<p align=\"left\">" . $row6[3] ."</p></div></td></tr>";
echo "<tr align = \"left\"><td> </td></tr>";
echo "<tr align =\"right\"><td>";
echo "<a href=\"index2.php?page=".$row6[1]. "&nt=". $row6[0]. "\"><font color=#CC6699>Leia mais</font>";
echo "</a></td></tr>";
}
} ?>
</table>
<hr color=#CC6699> <center>
<table width="100%">
<?php
//include("func.inc");
$query55 = "select idedicao from edicao
where ativada ='1'
and controle ='1'";
$res55 = mysql_query($query55, $conec) or die(mysql_error());
$idedicao = mysql_result($res55,0);
$query7 = "select idnoticia, notdata, notitulo, notcat
from noticias
where notedi = '$idedicao'
and destaque ='2'
and ativa ='1'
and idnoticia <> '$aux'
and controle ='1'
order by notdata desc";
$res7 = mysql_query($query7,$conec) or die(mysql_error());
while ($row7 = mysql_fetch_array($res7))
{
{ $data = $row7[1];
echo "<tr valign =\"top\" align = \"left\" ><td><b>";
echo iconvdat($data);
echo "</b></td><td><div align=\"left\">";
echo "<a href=\"index2.php?page=".$row7[3]. "&nt=". $row7[0]. "\">" . $row7[2];
echo "</a></div></td></tr>";
echo "<tr><td colspan=2><hr color=#CC6699 /></td></tr>";
} //include("menu.php");
}
?>Carregando comentários...