Ver Mensaje Individual
  #1 (permalink)  
Antiguo 25/01/2009, 00:32
tacuasin
 
Fecha de Ingreso: diciembre-2007
Mensajes: 4
Antigüedad: 16 años, 5 meses
Puntos: 0
Mensaje insertar varios registros y varios arrays

Muy buenas amigo les escribo pq tengo el siguiente problema
resulta que estoy intentando insertar varios registros de una sola vez, tengo un formulario donde se van creando varias filas dependiendo de cuantos registre almacene una tabla, ahi perfecto me los genera tal cual, no me repite nombres de input text ni nada, pero cuando inserto no encuentro como recuperar los datos, dejo los codigos para que me ayuden
Código HTML:
  do 
  { 
  	$i++;
  ?>
        <tr>
          <td><?php echo $row_Alumno['acarnet']; ?><input name="acarnet" type="hidden" value="<?php echo $row_Alumno['acarnet']; ?>" /></td>
          <td><?php echo $row_Alumno['aapellido']; ?>, <?php echo $row_Alumno['anombre']; ?></td>
          <td><input name="A<?php echo $i ?>" type="text" id="Nota1" size="5" maxlength="5" /></td>
          <td><input name="B<?php echo $i ?>" type="text" id="Nota2" size="5" maxlength="5" /></td>
          <td><input name="C<?php echo $i ?>" type="text" id="Nota3" size="5" maxlength="5" /></td>
        </tr>
        <?php } while ($row_Alumno = mysql_fetch_assoc($Alumno)); ?> 
Código PHP:
for ($x=1$x==$i$x++)
        {
            echo 
"$x<br>";
            
$insertSQL sprintf("INSERT INTO nota (idNota, Nota1, Nota2, Materia_idMateria, Alumno_acarnet) VALUES (%s, %s, %s, %s, %s)",
                       
GetSQLValueString($_POST['idNota'], "int"),
                       
GetSQLValueString($_POST['A[$x]'], "int"),
                       
GetSQLValueString($_POST['B[$x]'], "int"),
                       
GetSQLValueString($_POST['select'], "text"),
                       
GetSQLValueString($_POST['acarnet'], "text"));

              
mysql_select_db($database_conexion$conexion);
            
$Result1 mysql_query($insertSQL$conexion) or die(mysql_error());
        } 
Gracias desde antemano!!!