Ver Mensaje Individual
  #1 (permalink)  
Antiguo 29/11/2013, 03:28
juan_f_amaral
 
Fecha de Ingreso: noviembre-2013
Mensajes: 12
Antigüedad: 10 años, 5 meses
Puntos: 0
Pregunta Guardar multiples datos de formulario generado

Hola gente, estoy con un problema que no puedo resolver, estoy mostrando datos de alumnos inscriptos a una materia, los muestro en una tabla para tomarles asistencia, el problema es que la cantidad de alumnos que debo mostrar es diferente es curso. pude mostrarlos bien, pero luego quise agregar un contador para que cada radio(presento o ausente) tengo nombre distinto y pueda recuperarlos mediante un $_POST.

La duda es si me plantee bien el problema, y cual es el error que tengo ya que como tengo el codigo asi me tira este error en el Arreglo

"Notice: Undefined variable: arreglo "

les dejo el codigo:

Código PHP:


<html>
<body>


  <?php
include 'style.php';
include 
'conexion.php';


//RECUPERA LOS DATOS DE LA MATERIA Y EL AÑO LECTIVO DE ESTA
$carrera=$_REQUEST["carrera"];
$anio_lectivo=$_REQUEST["anio_lectivo"];
$id_materia=$_REQUEST["id_materia"];
$nombre_materia=$_REQUEST["nombre_materia"];
//MEDIANTE ID RECUPERA NOMBRE DE CARRERA PARA MOSTRARLA EN TITULO
$sql "SELECT Nombre_Carrera  FROM carrera WHERE id_Carrera = ".$carrera."  ";
$result mysql_query($sql$link);
$row mysql_fetch_array($result);
$carrera=$row[0];


//MUESTRA EN TITULO LOS DATOS DEL CURSO

echo "<h1 align='center' class='ui-state-active ui-corner-all ui-widget-content' > A&Ntilde;O: &nbsp;".$anio_lectivo."&nbsp;&nbsp;&nbsp; ".$nombre_materia.",&nbsp;&nbsp; ".$carrera."</h1>";


//TRAE LOS ALUMNOS INSCRIPTOS A ESA MATERIA

$sql "SELECT id_alumno, id_Materia  FROM materia_alumno WHERE id_Materia = ".$id_materia."  ";

$result mysql_query($sql$link);

if (
$row mysql_fetch_array($result)){

echo 
"<table border = '1' class='ui-state-active ui-corner-all ui-widget-content' > \n
<tr><td>id_alumno</td><td>nombre</td><td>id_materia</td>
"
;

//DEFINO EL CONTADOR DEL ARRAY
$i=0;


do {
$sql "SELECT Nombre FROM alumno WHERE id_alumno = ".$row[0]."  ";
$resultado mysql_query($sql$link);
$fila mysql_fetch_array($resultado);

echo 
"</tr> \n";
echo 
"<tr> \n";

echo 
"<td>".$row[0]."</td> \n";
echo 
"<td>".$fila[0]."</td> \n";
echo 
"<td>".$row[1]."</td> \n";


echo 
"<td>

Presente <input name='"
.$arreglo[$i]."' type='radio' value='Presente' checked></br>
Ausente &nbsp;<input name='"
.$arreglo[$i]."' type='radio' value='Ausente' >"


;

echo 
"</tr> \n";
//SUMA 1 AL CONTADOR
$i++;

} while (
$row mysql_fetch_array($result));

echo 
"<p><a class='ui-state-active ui-corner-all ui-widget-content' href=Asistencia.php>Volver</p> \n";

echo 
"</table> \n";

} else {

echo 
"<p class='ui-state-active ui-corner-all ui-widget-content' >Materia sin alumnos inscriptos </p>\n";

echo 
"<p class='ui-state-active ui-corner-all ui-widget-content' ><a href=.Asistenciaphp>Volver</p> \n";

}

?></p>
</body>
</html>
Me pueden decir el error que tengo, y tambien como podria recuperar todos los datos que se produscan?