チェックボックスをONにした配列をupload.phpに送りたいです。すべてのチェックボックスには、mysql 列から抽出されたデータのペアが必要です:CodigoCurso
およびHorarioid
. これらの情報を に送信できませんupload.php
。どうすればこれを実行できますか?
<?php
session_start();
$connection = mysql_connect("localhost", "root", "");
mysql_select_db("mydb", $connection);
$query = "SELECT Curso.CursoId, Hora.Horarioid,Persona.Cedula,Curso.CodigoCurso,Curso.NombreCurso,Curso.Creditos,Hora.Hora,Horario.PersonasMatriculadas FROM Persona INNER JOIN PreMatriculaEstudiante,Prematricula,Curso,Horario,Hora WHERE Persona.PersonaId = PreMatriculaEstudiante.PersonaId AND PreMatriculaEstudiante.PrematriculaID = Prematricula.PrematriculaId AND Prematricula.CursoId = Curso.CursoId AND Curso.CursoId = Horario.CursoId AND Horario.HorarioId = Hora.HorarioId AND Persona.Cedula = '" . $_SESSION["cedula"] . "'";
$result = mysql_query($query);
if ($row = mysql_fetch_array($result)) {
echo "<form action='upload.php' method='POST'>";
echo "<table border = '1'> \n";
echo "<tr><td><b>Código Curso</b></td><td><b>Nombre Curso</b></td><td><b>Horario</b></td><td><b>Personas matriculadas</b></td></tr>";
$k = 0;
$t = 0;
while ($array = mysql_fetch_array($result)) {
echo "<tr>
<td>" . $array['CodigoCurso'] . "</td>" .
"<td align='left'>" .
"<input type='checkbox' name='info[$k][$k]' value='" . $array['CursoId'] . $array['Horarioid'] . "'.nonchecked>" . utf8_encode($array['NombreCurso']) . "</td>" .
"<td>" . $array['Hora'] .
"<td>" . $array['PersonasMatriculadas'] . "</td>" .
"</tr>";
$k++;
$t++;
}
echo "</table> \n";
echo "<p>";
echo "<input type='submit' value='Ingresar datos'/>";
echo "</p>";
echo "</form>";
} else {
echo "¡ No se ha encontrado ningún registro !";
}