Bueno Gente, estuve buscando por los foros información pero no llegue a encontrar lo que yo necesito especificamente.
Lo que hago es tomar datos de la db y luego armar distintos radio buttons para tomar información, los guardo en un array.
Código PHP:
$result = sql_query("select local, visitante, resultado from liga_partidos where jornada='$fechas' and tid='2'", $dbi);
$a=1;
while(list($local, $visitante, $res) = sql_fetchrow($result, $dbi)) {
echo "<form name=\"form1\" method=\"post\" action=\"modules.php?name=Fixture&file=prode&op=Grabar\">";
echo " <tr>\n";
echo " <td width=\"3%\" style=\"border-left-color: #000000; border-right-color: #000000; border-top-color: #000000; border-top-width: 1px; border-bottom-color: #000000; border-bottom-width: 1px\">
<input type=\"radio\" name=\"resultado[]\" Value='L'></td>\n";
echo " <td width=\"47%\" style=\"border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium\"> $local</td>\n";
echo " <td width=\"3%\" style=\"border-left-color: #000000; border-right-color: #000000; border-top-color: #000000; border-top-width: 1px; border-bottom-color: #000000; border-bottom-width: 1px\">
<input type=\"radio\" name=\"resultado[]\" Value='E'></td>\n";
echo " <td width=\"40%\" style=\"border-top: 1px none #000000; border-bottom: 1px none #000000; \"> $visitante</td>\n";
echo " <td width=\"3%\" style=\"border-left-color: #000000; border-top-color: #000000; border-top-width: 1px; border-bottom-width: 1px; border-bottom-color:#000000\" bordercolorlight=\"#000000\" bordercolordark=\"#000000\">
<input type=\"radio\" name=\"resultado[]\" Value='V'></td>\n";
echo " </tr>\n";
$a++;
}
echo "</table>\n";
echo "<br><center><input type=\"submit\" value=\"Enviar\"></form></center>";
Luego las tomo con el siguiente codigo
Código PHP:
foreach ($_POST['resultado'] as $nombre){
echo $nombre."<br>";
}
con ese codigo recorro el array y veo las opciones seleccionadas, ahora yo necesito cada una de esas opciones guardarlas en la DB cada una en un registro distinto. Estuve probando pero no me sale, si alguien puede darme una mano le voy a agradecer.
Saludos