Ver Mensaje Individual
  #4 (permalink)  
Antiguo 03/09/2005, 18:07
Avatar de Seppo
Seppo
 
Fecha de Ingreso: marzo-2005
Ubicación: Buenos Aires, Argentina
Mensajes: 1.284
Antigüedad: 19 años, 1 mes
Puntos: 17
A ver si ahí está mejor...
Igual te recomiendo que en la consulta pongas un "LIMIT 5" al final. En caso de hacer eso, podés borrar el $mostrar y poner el while sin el IF adentro... además estás trayendo todos los registros, si existen 1.000.000 cargado va a tardar muchísimo sin sentido
Código PHP:
<? 
$mostrar 
5
include(
'config.php'); 
$query "select * from foros order by fecha desc"
$resp mysql_query($query); 
print 
"<table width=780 border=1>"
print 
"<tr><td>Categoría</td><td>Autor</td><td>Título</td></tr>"
while (
$datos mysql_fetch_array($resp)) { 
  if (
$mostrar 0) { 
    print 
"<tr><td>"
    
$fecha date("d/m/Y",$datos[fecha]); 
    
$foroid $datos['id']; 
    
$codigo $datos['idautor']; 
    
$quien $datos['autor']; 
    
$tema $datos['titulo']; 
    print 
"<b>$datos[categoria]</b>"
    print 
"</td><td>"
    echo 
"<a class='vinculo' title='ver perfil de $quien' href=perfil.php?id=$codigo>$quien</a>"
    print 
"</td><td>"
    echo 
"<a class='vinculo' title='Enviado el $fecha' href=foro.php?id=$foroid>$tema</a>"
    print 
"</td></tr>";
    
$mostrar--; 
  } else {
    print 
"</table>"
  }

?>