Ver Mensaje Individual
  #3 (permalink)  
Antiguo 30/09/2008, 11:12
Avatar de farra
farra
 
Fecha de Ingreso: marzo-2008
Ubicación: Aqui estoy
Mensajes: 574
Antigüedad: 16 años, 2 meses
Puntos: 20
Respuesta: imprimir 2 veces el mismo recorset

Código PHP:
<?php  
mysql_select_db
($database$con); 
$query_Noticias "SELECT Idnoticia Title, Texto, Fec_pub FROM noticiario limit 5"
$Noticias mysql_query($query_Noticias$con) or die(mysql_error()); 
$row_Noticias mysql_fetch_assoc($Noticias); 
$totalRows_Noticias mysql_num_rows($Noticias); 
 
?> 

Primera: 
<?php do{ ?>  
<a href="noticia.php?id=<?php echo $row_Noticias['Idnoticia']; ?>"><?php echo $row_Noticias['Titulo']; ?></a><br /> 
<?php } while ($row_Noticias mysql_fetch_assoc($Noticias)); ?> 

Segunda: 
<?php reset($Noticias); do{ ?>  
<a href="noticia.php?id=<?php echo $row_Noticias['Idnoticia']; ?>"><?php echo $row_Noticias['Titulo']; ?></a><br /> 
<?php } while ($row_Noticias mysql_fetch_assoc($Noticias)); ?> 


La segunda no funciona...
ERROR: Warning: reset() [function.reset]: Passed variable is not an array or object in C:\wamp\www\misitio\noticias.php on line 37
__________________
Firma:
Es mas dificil para el mono entender que el hombre desciende de el....

PD: Siempre doy karma al que me da una buena respuesta... ;0)