Ver Mensaje Individual
  #5 (permalink)  
Antiguo 27/07/2006, 07:44
Avatar de .php
.php
 
Fecha de Ingreso: julio-2006
Mensajes: 481
Antigüedad: 17 años, 8 meses
Puntos: 5
listo browser, spero que haya quedado bien, este es el codigo que te serviria.
Código:
<center>
<table x:str border=0 cellpadding=4 cellspacing=0 width=200 style='border-collapse:'>
<TH width=40>Fecha</TH>
<TH width=80>Descripcion</TH>
<TH width=80>Nombre</TH>
</tr>
<?php
	$db 	    = 	mysql_connect(localhost,xxx,xxxx);
	mysql_select_db(noticias);
	$sql	    =	"SELECT * FROM enlaces";
	$cont       = 	True;
	$MaxRows    =	10;
	$StartRows  =	0;
	$PagNum	    =	$_GET["PagNum"];
	$StartRows  =	$PagNum * $MaxRows;
	$query      =	sprintf("%s LIMIT %d, %d", $sql." order by fecha ASC ", $StartRows, $MaxRows);
	$result     =	mysql_query($query);
	$Contador   =	mysql_num_rows($result);
	while($row  =	mysql_fetch_array($result)) {
		$id	=	fsalida($row["enlaceid"]);
		$fecha	=	date("d/m/Y",$row["fecha"]);
		if($cont ==	True){
			$fondo	= "bgcolor='#CCCCCC'";
			$cont 	= False;
		}else{
			$fondo	= "bgcolor='#F5F5F5'";
			$cont	= True;
		}
		printf("<tr><td align=right width='40' $fondo><font size='2' face='Arial, Helvetica, sans-serif'>%s</td>", $fecha);
		printf("<td width='80' $fondo><font size='2' face='Arial, Helvetica, sans-serif'>%s</td>", $row["descripcion"]);
		printf("<td width='80' $fondo><font size='1' face='Arial, Helvetica, sans-serif'>%s</td>", $row["nombre"]);
		printf("</td></tr>");
	}
	$PagTot = ($Contador) / $MaxRows;
?>
</table>
<?
   echo "<p><tr><table>";
   $fila = 1;
   for($i=1; $i<$PagTot+1; $i++){
       if($i == (40 * $fila)){
             $fila++;
             $salto="</tr><tr>";
       }
       else{
           $salto="";
       }
       $p = $i - 1;
   }
?>
  <TABLE align="center">
    <TR>
  <?
   if($PagNum>0){ ?>
    <TD>
      <A href='index.php?PagNum=0'><img src="../img/First.gif" border=0></A>
    </TD>
    <TD>
      <A href='index.php?PagNum=<? echo $PagNum - 1; ?>'><img src="../img/Previous.gif" border=0></A>
    </TD>
    <? }
    if($PagNum<$p){ ?>
    <TD>
      <A href='index.php?pert=PagNum=<? echo $PagNum + 1; ?>'><img src="../img/Next.gif" border=0></A>
    </TD>
    <TD>
      <A href='index.php?PagNum=<? echo $p; ?>'><img src="../img/Last.gif" border=0></A>
    </TD>
    <? } ?>
  </TR>
  </TABLE>
 </CENTER>