Problemas com consulta sql
Ola pessoal, estou com um problema aqui q é o seguinte, eu quero fazer um home para meu site que na page inicial mostre 10 noticias, mais ai que está o problema, eu não sei o que eu faço para limitar o numero de noticias de aparece por linha
<style>
.video {
position:relative;
top:-35px;
}
.post {
position:relative;
width:340px;
}
</style>
<table width="980" border="0" align="center">
<tr>
<td width="680" height="246"><?php include 'slide.php'; ?></td>
<td width="290"><div class="video" ><iframe width="290" height="268" src="http://www.youtube.com/embed/z742eN2oE0I" frameborder="0" allowfullscreen></iframe></div></td>
</tr>
</table>
<table width="980" style="height:auto;"border="0" align="center">
<tr>
<?php
$sql = "select * from posts";
$query = mysql_query($sql);
while ($geral = mysql_fetch_assoc($query))
{
?>
<td width="827" height="88" valign="bottom" ><div class="post"><table width="340" border="0" >
<tr>
<td width="340" height="38" align="center"><img src="<?php echo $geral['img_post'] ?>" width="340" height="159"></td>
</tr>
<tr>
<td ><?php echo $geral['desc_post']; ?></td>
</tr>
<tr>
<td><?php echo $geral['infos_post']; ?></td>
</tr>
</table></div></td> <?php } ?>
</tr>
</table>
<p> </p>
o problema e que a hora que eu adiciono mais de 3 noticias o tamanho excede e começa a expandir a pagina para os lados, e eu queria que apenas mostrasse duas postagens por linha
se puderem me ajuda eu agradeço, valeu pessoal
Discussão (4)
Carregando comentários...