Ver Mensaje Individual
  #3 (permalink)  
Antiguo 16/06/2012, 00:30
avenda
 
Fecha de Ingreso: agosto-2009
Mensajes: 30
Antigüedad: 14 años, 8 meses
Puntos: 0
Respuesta: Paginar Noticias

Trate de integrar uno pero me sale los siguientes errores.

Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in /home/***/public_html/web/noticias.php on line 106

Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/***/public_html/web/noticias.php on line 107


Este es mi código de la pagina de noticias

Código PHP:
<?php include_once("config.php"); ?>
Código PHP:
<?php
$conex 
mysql_connect ("$servidor","$usuario","$password");
if (!
$conex)
{
die(
'NO puede conetarse: ' mysql_error());
}
mysql_select_db ("$database"$conex);
$registros 2;
if (!
$pagina) { 
    
$inicio 0
    
$pagina 1

else { 
    
$inicio = ($pagina 1) * $registros
}
$resultados mysql_query("SELECT id FROM noticia WHERE visible = 1"); $total_registros mysql_num_rows($resultados); $resultados mysql_query("SELECT * FROM noticia WHERE visible = 1 ORDER BY `id` DESC LIMIT $inicio, $registros"); $total_paginas ceil($total_registros $registros);
while(
$mostrador mysql_fetch_array($resultados))
{
echo 
"</br><center><a href=detalle.php?id=$mostrador[id]>";
echo 
'<h2>'.$mostrador['titulo'].'</h2>';
echo 
"<img src=images_bd.php?id=$mostrador[id]&tam=2 class=border >";
echo 
"</a></center></br>";
echo 
$mostrador['subtitulo'];
echo 
"<br /><br />";
echo 
"Categoria: ";
echo 
$mostrador['categoria'];
echo 
"</br></br></br>";
}

if((
$pagina 1) > 0) { echo "<a href='paginacion.php?pagina=".($pagina-1)."'>< Anterior</a> "; }
for (
$i=1$i<=$total_paginas$i++){ if ($pagina == $i){ echo "<b>".$pagina."</b> "; } else { echo "<a href='paginacion.php?pagina=$i'>$i</a> "; }}
if((
$pagina 1)<=$total_paginas) { echo " <a href='paginacion.php?pagina=".($pagina+1)."'>Siguiente ></a>"; }

mysql_close($conex);
?>
en que podre estar fallando?