Ver Mensaje Individual
  #3 (permalink)  
Antiguo 14/07/2009, 17:05
Avatar de asassa
asassa
 
Fecha de Ingreso: julio-2008
Ubicación: En el DF ectuoso
Mensajes: 240
Antigüedad: 18 años, 3 meses
Puntos: 0
Respuesta: ayuda con problema al listar resultados

en efecto deberias usar esas que te mencionan o en su defecto te paso un ejenmplo
Código PHP:
<?Php $servidor = "localhost"; $usuario_bd = "root"; $password_bd = "root"; $basedatos = "log"; $conexion = mysql_connect($servidor,$usuario_bd,$password_bd); if (!$conexion) {     echo "Error conectando a la base de datos.";    exit(); } $resultado=mysql_select_db($basedatos,$conexion); if (!$resultado) {     echo "Error seleccionando la base de datos.";  exit(); }?> 

<?php
   $queEmp 
= "SELECT   id, nombre, email, status, asignacion from perfiles ";            
      
$resEmp = mysql_query($queEmp, $conexion);
       
$totEmp = mysql_num_rows($resEmp);    
echo 
" <table width='100%' border='0' align='center' cellpadding='2' cellspacing='2'>";
echo 
"  <tr> ";
echo 
"  <td width='40%' bgcolor='#CCCCCC'><div align='center'>NOMBRE</div></td>";
echo 
"  <td width='20%' bgcolor='#CCCCCC'><div align='center'>EMAIL</div></td>";
echo 
"  <td width='15%' bgcolor='#CCCCCC'><div align='center'>STATUS</div></td>";
echo 
"    <td width='15%' bgcolor='#CCCCCC'><div align='center'>ASIGNACION</div></td>";
echo 
"    <td width='50%' bgcolor='#CCCCCC'><div align='center'>IMAGEN</div></td>";
echo 
" </tr>";
  
?>
  <?php
    
if( $totEmp > 0 ) {     
             while( 
$row_sel2 = mysql_fetch_array($resEmp) ) { 
  
?>
 
</TR>
      <tr>
    <td width="100" bgcolor="#FFFFF0"><div align="center"><?php echo $row_sel2['nombre']   ?></div></td>
    <td width="85"  bgcolor="#FFFFF0"><div align="center"><?php echo $row_sel2['email'] ?></div></td>
    <td width="135" bgcolor="#FFFFF0"><div align="center"><?php echo $row_sel2['status'] ?></div></td> 
    <td width="145" bgcolor="#FFFFF0"><div align="center"><?php echo $row_sel2['asignacion'] ?></div></td>   
    <td width="231" bgcolor="#CCCCCC"><div align="center">:<a href="formulario2.php?variable1=<?php echo $row_sel2['nombre'] ?>&variable2=<?php echo $row_sel2['email'] ?>&variable3=<?php echo $row_sel2['status'] ?>&variable4=<?php echo $row_sel2['asignacion'] ?>&variable5=<?php echo $row_sel2['id'] ?>  " target="_blank" onClick="window.open(this.href,this.target,'width=900,height=500'); window.close; return false;"><?php echo "AGREGA IMAGEN"?></a></div></td>                
  </tr>
  <?php 
        
} 
    }  
    
?>
</table>
y con que modifiques el query es mas que suficiente