Ver Mensaje Individual
  #4 (permalink)  
Antiguo 06/10/2009, 08:43
Avatar de gjx2
gjx2
 
Fecha de Ingreso: agosto-2008
Ubicación: R.D
Mensajes: 1.153
Antigüedad: 15 años, 8 meses
Puntos: 139
Respuesta: Recoger valor de fila, dependiente del registro mostrado.

Realmente no se por que usas esa forma para imprimir los valores.
revisa este ejemplo un poquito mas legible.

Código PHP:
Ver original
  1. <script>
  2. function pagUrl(id){
  3. window.location.href = "pdfhvida.php?id_empleado=" + id;
  4. }
  5. </script>
  6.  
  7. <table cellpadding="0" cellspacing="0" width="500" border="1">
  8. <tbody>
  9.     <tr>
  10.     <th>Nombre</th>
  11.     <th>Edad</th>
  12.     <th>Departamento</th>
  13.     <th>Foto</th>
  14.     </tr>
  15.    
  16.    
  17.     <?php while($resultado = mysql_fetch_array($consulta)): ?>
  18.    
  19.    
  20.     <tr>
  21.     <td><?php echo $resultado["Nombre"] ?></td>
  22.     <td><?php echo $resultado["Edad"] ?></td>
  23.     <td><?php echo $resultado["Departamento"] ?></td>
  24.     <td><img src="#" onClick="PagUrl('<?php echo $resultado["identificacion"]?>')"></td>   
  25.     </tr>  
  26.    
  27.    
  28.    
  29.     <?php endwhile; ?>
  30.    
  31.     </tbody>
  32.     </table>