Ver Mensaje Individual
  #1 (permalink)  
Antiguo 14/09/2010, 10:41
mixcoatltzin
 
Fecha de Ingreso: julio-2010
Ubicación: mexico DF
Mensajes: 34
Antigüedad: 13 años, 9 meses
Puntos: 0
Pregunta Ayuuuda!!!! Como imprimir en una tabla multiples registro de historial

compañeros lo que necesito es imprimir una tabla de acuerdo al numero de registros asociados a un determinado ID este ID ya lo tengo dentro de un array
creo que podria ser con un while pero no me funciona solo me imprime el primer registro asociado al ID de mi array, esto me va a servir para que en una tabla me muestre el hitorial de pagos de un alumno, aqui muestro el codigo

Código PHP:
<?php require_once('Connections/cn.php'); ?>
<?php

$valor
=$_GET["ID"];
mysql_select_db($database_cn$cn);
$sql="select * from pagos where ID_alumno='$valor'  ";
$sql1="select * from alumnos where ID='$valor' ";

$r=mysql_query($sql);
$r2=mysql_query($sql1);
$res=mysql_fetch_array($r);
$res2=mysql_fetch_array($r2);

?>
con este codigo extraigo de mi BD e introduzco a un array, ahora mi tabla

Código HTML:
<table border="1">
  <tr style="background-color:#0099FF">
    <td valign="top" align="center" width="100"><strong>N° de pago</strong></td>
    <td valign="top" align="center" width="300"><strong>Nombre</strong></td>
    <td valign="top" align="center" width="200"><strong>Concepto</strong></td>
	<td valign="top" align="center" width="70"><strong>periodo</strong></td>
	<td valign"top" align="center" width="150"><strong>cantidad</strong></td>
	<td valign="top" align="center" width="100"><strong>N° de factura</strong></td>
	<td valign="top" align="center" width="80"><strong>Fecha</strong></td>
	<td valign="top" align="center" width="80"><strong>Hora</strong></td>
	<td valign="top" align="center" width="80"><strong>Funcion</strong></td>
    <tr>
	  <td><?php echo $res['ID']; ?></td>
      <td><?php echo $res2['nombre']; ?></td>
      <td><?php echo $res['conceptopago']; ?></td>
	  <td><?php echo $res['periodopago']; ?></td>
	  <td><?php echo $res['cantidad']; ?></td>
	  <td><?php echo $res['facorec']; ?></td>
	  <td><?php echo $res['fechapago']; ?></td>
	  <td><?php echo $res['hora']; ?></td>
	  <td width="55" align="center" valign="top">
	  <a href="adminpagos.php?ID=<?php echo $res2['ID'];?>" title="Regustrar Pago">
		<img src="pago.bmp" width="24" height="24" border="0"> 
	  </a>
	  </td> 
  </tr>
</table> 
EN DONDE IRIA EL CICLO PARA REPETIR LA IMPRESION DE REGISTROS CONTINUOS