Código PHP:
<?php
error_reporting(E_ALL);
require("includes/conn.php");
$link = Conectarse();
$contar = mysql_query("SELECT * FROM noticias") or die(mysql_error());
$sacarnoticias = mysql_query("SELECT * FROM noticias order by id DESC") or die(mysql_error());
while ($contador = mysql_fetch_assoc($contar)){
$conta++;
}
?>
<html>
<head>
<title>Documento sin título</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="estilos.css" rel="stylesheet" type="text/css">
</head>
<style>
<!--
body
{
scrollbar-face-color: #FFFFFF;
scrollbar-arrow-color: #FA0000;
scrollbar-highlight-color: #ffffff;
scrollbar-3dlight-color: #FFFFFF;
scrollbar-shadow-color: #FFFFFF;
scrollbar-darkshadow-color: #FA0000;
scrollbar-track-color: #FFFFFF;<br>
background-color: #FA0000
}
//-->
</style>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<? if ($conta<1){?>
<br>
<div align="center"><span class="texto">No Hay Productos en esta Sección</span></div><? }?>
<? while ($vernoticias = mysql_fetch_assoc($sacarnoticias)){
$foto = $vernoticias["foto"];
$copete = $vernoticias["copete"];
$id = $vernoticias["id"];
$title = $vernoticias["titulo"];
?><table width="400" height="98" border="0" cellpadding="0" cellspacing="0" class="estilos">
<tr><? if ($foto!=""){?>
<td width="95" height="90">
<div align="justify"> <span class="texto"><img src="../fotos/<? echo $foto; ?>" width="90" height="90" hspace="0" vspace="0" align="left"></span></div></td><? } else { ?>
<td width="95" height="90"><img src="blank.gif" width="90" height="90" hspace="0" vspace="0" align="left"></td>
<? } ?>
<td width="284" valign="top"><br>
<table width="100%" border="0" align="left" cellpadding="0" cellspacing="0">
<tr><?
if(strlen($title)>70) {?>
<td align="left"><span class="texto"><? print substr($title, 0, 70); ?>...
</span>
<? }
else {?>
<td align="left"><span class="texto"><? print substr($title, 0, 70); ?> </span> <? } ?>
</tr>
<tr>
<td align="left"><span class="texto"><? echo eregi_replace(chr(13),"<br>",$copete),"[...]"; ?>
<a href="../noticia.php?id=<? echo $id; ?>" class="enlaces">leer más
>></a></span> </td>
</tr>
</table></td>
</tr>
</table>
<br>
<table width="400" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="6"><img src="imagenes/separa.gif" width="400" height="6"></td>
</tr>
</table>
<? } ?>
</body>
</html>
La seccion que pongo a continuacion es la que necesito paginar, ahora mismo esta sacando todos los resultados
Código PHP:
<? while ($vernoticias = mysql_fetch_assoc($sacarnoticias)){
$foto = $vernoticias["foto"];
$copete = $vernoticias["copete"];
$id = $vernoticias["id"];
$title = $vernoticias["titulo"];
?><table width="400" height="98" border="0" cellpadding="0" cellspacing="0" class="estilos">
<tr><? if ($foto!=""){?>
<td width="95" height="90">
<div align="justify"> <span class="texto"><img src="../fotos/<? echo $foto; ?>" width="90" height="90" hspace="0" vspace="0" align="left"></span></div></td><? } else { ?>
<td width="95" height="90"><img src="blank.gif" width="90" height="90" hspace="0" vspace="0" align="left"></td>
<? } ?>
<td width="284" valign="top"><br>
<table width="100%" border="0" align="left" cellpadding="0" cellspacing="0">
<tr><?
if(strlen($title)>70) {?>
<td align="left"><span class="texto"><? print substr($title, 0, 70); ?>...
</span>
<? }
else {?>
<td align="left"><span class="texto"><? print substr($title, 0, 70); ?> </span> <? } ?>
</tr>
<tr>
<td align="left"><span class="texto"><? echo eregi_replace(chr(13),"<br>",$copete),"[...]"; ?>
<a href="../noticia.php?id=<? echo $id; ?>" class="enlaces">leer más
>></a></span> </td>
</tr>
</table></td>
</tr>
</table>
<br>
<table width="400" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="6"><img src="imagenes/separa.gif" width="400" height="6"></td>
</tr>
</table>
<? } ?>
Desde ya muchisimas gracias!! Saludos!!