Ver Mensaje Individual
  #7 (permalink)  
Antiguo 09/04/2012, 18:48
chubse
 
Fecha de Ingreso: marzo-2012
Mensajes: 84
Antigüedad: 12 años, 1 mes
Puntos: 3
Respuesta: Insertar un array en una tabla de MySQL

Gracias johhan16:

Código formulario
Código PHP:
<?php
   
   $usu_alum
=mysql_query("SELECT ID_ALUMNO FROM ml_dat_ALUMNO WHERE ID_GRUPO = '$nombre_gpo'");
   
$row_asist mysql_fetch_array($usu_alum);
   
$n_alumnos count($row_asist);
    
$i 1;                                                  
   
   
echo 
'<form action="CONEXION_ASISTENCIA.php" id="asist" method="POST">';

echo 
"<tr>";

echo 
"<b>Alumno</b>";

echo 
"<b>Asistencia</b>";

echo 
"<b>Fecha de asistencia</b>";

echo 
"</tr>";

while (
$n_alumnos >= $i){

echo 
"<tr> \n";

echo 
"<input type='text' name='ID_GRUP[$i]' id='ID_GRUP' value='$row_gpo[0]' />";

echo 
"<input type='text' name='ALUMNOS[$i]' value='$row_asist[0]'></input> \n";

echo 
"<input type='text' name='ASIST[$i]' value=''><font size='-1'></input> \n";

echo 
"<input type='text' name='FECHA_ASISTENCIA[$i]' value=''></input> \n";


$i++;}

echo 
"<input type='submit' name='ENVIAR' id='ENVIAR' value='Guardar'><input type='reset' name='RESTABLECER' id='RESTABLECER' value='Borrar datos'>;
 
echo '</form>';
 
 ?>
Sólo me pinta en el formulario 2 alumnos (cuando tengo 4) y sólo el primero (me pinta 2 veces el 1er alumno).

Gracias y saludos