Ver Mensaje Individual
  #1 (permalink)  
Antiguo 22/09/2010, 12:07
Avatar de Lautaro_eb
Lautaro_eb
 
Fecha de Ingreso: mayo-2010
Ubicación: Bariloche, Argentina
Mensajes: 284
Antigüedad: 14 años
Puntos: 24
Error en while ?

Buenas Este es mi codigo se suponian que el while repita la funcion asta llegar ala verdadero tiene un total de dos lineas en la db y pone una sola.
Pero el $total me da el resultado verdadero gracias.
Código PHP:
        $sql "select * from comentariosinf where id = '".$_GET['id']."'";
        
$query mysql_query($sql);
        
$total mysql_num_rows($query);
        echo 
$total;
        while(
$fila mysql_fetch_assoc($query)){
            echo 
"<table border='0' width='50%'>
            <tr>
            <td height='15%' valign='top'>"
;
            
$sql "select id from usuarios where nombreus = '".$fila['nombre']."'";
            
$query mysql_query($sql);
            
$ID mysql_result($query,0);
            echo 
"<a href='http://201.251.133.27/basketball/verperfil.php?id=".$ID."'>".$fila['nombre']."</a> <br>  ".$fila['fecha']."</td> 
            <td height='15%' width='80%' valign='left'>"
.nl2br(ucfirst($fila['comentarios']))."            
            </td>
            </tr>
            </table>"
;
        }