Noticias
echo $noticia->titulo;?>
if($num_total_registros) echo 'Se obtuvieron '.$num_total_registros.' resultados';?> if($num_total_registros > $TAMANO_PAGINA){?> 1 echo $pag;?> echo $total_paginas;?> }?>
include "datos.php"; if(!$id = $_REQUEST["id"]){ $TAMANO_PAGINA = 5; @ $pag = $_GET["pag"]; if (!$pag) { $inicio = 0; $pag = 1; } else { $inicio = ($pag - 1) * $TAMANO_PAGINA; } $titular = $_REQUEST["titular"]; $noticias = mysql_query("select * from noticias where titulo like '%".$titular."%' or texto like '%".$titular."%' order by fecha desc", $conexion); //$num_total_registros = mysql_num_rows($noticias); $num_total_registros = 0; while($fila = mysql_fetch_object($noticias)){ if($fila->afiliados == 'no'){ $num_total_registros++; } } $total_paginas = ceil($num_total_registros / $TAMANO_PAGINA); $noticias = mysql_query("select * from noticias where afiliados = 'no' and ( titulo like '%".$titular."%' or texto like '%".$titular."%') order by fecha desc limit ".$inicio.",".$TAMANO_PAGINA); } else{ $noticias = mysql_query("select * from noticias where id='$id'", $conexion); } ?>
if($num_total_registros) echo 'Se obtuvieron '.$num_total_registros.' resultados';?> if($num_total_registros > $TAMANO_PAGINA){?> 1 echo $pag;?> echo $total_paginas;?> }?>