Ver Mensaje Individual
  #2 (permalink)  
Antiguo 14/06/2009, 21:32
Avatar de abimaelrc
abimaelrc
Colaborador
 
Fecha de Ingreso: mayo-2009
Ubicación: En el planeta de Puerto Rico
Mensajes: 14.734
Antigüedad: 17 años, 4 meses
Puntos: 1517
Respuesta: Ayuda con actualizar datos multiples

Lo primero vas a tener que crear el form y sus campos como array

Código PHP:
           print ("<TR>\n");  
            print (
"<TD>" . "<input type='text' name='codalumno' size='10' value='$resultado[0]'readonly />" . "</TD>\n");   
            print (
"<TD>" . $resultado['nombre'] . "</TD>\n"); 
            print (
"<TD>" . $resultado['apellido'] . "</TD>\n"); 
            print (
"<TD>" . "<input type='text' name='lab1[]' size='3' value='$resultado[13]'>" . "</TD>\n"); 
            print (
"<TD>" . "<input type='text' name='act1[]' size='3' value='$resultado[14]'>" . "</TD>\n"); 
            print (
"<TD>" . "<input type='text' name='par1[]' size='3' value='$resultado[15]'>" . "</TD>\n"); 
            print (
"<TD>" . "<input type='text' name='prom1[]' size='3' value='$resultado[16]'>" . "</TD>\n"); 
            print (
"<TD>" . "<input type='text' name='lab2[]' size='3' value='$resultado[17]'>" . "</TD>\n"); 
            print (
"<TD>" . "<input type='text' name='act2[]' size='3' value='$resultado[18]'>" . "</TD>\n"); 
            print (
"<TD>" . "<input type='text' name='par2[]' size='3' value='$resultado[19]'>" . "</TD>\n"); 
            print (
"<TD>" . "<input type='text' name='prom2[]' size='3' value='$resultado[20]'>" . "</TD>\n"); 
            print (
"<TD>" . "<input type='text' name='lab3[]' size='3' value='$resultado[21]'>" . "</TD>\n"); 
            print (
"<TD>" . "<input type='text' name='act3[]' size='3' value='$resultado[22]'>" . "</TD>\n"); 
            print (
"<TD>" . "<input type='text' name='par3[]' size='3' value='$resultado[23]'>" . "</TD>\n"); 
            print (
"<TD>" . "<input type='text' name='prom3[]' size='3' value='$resultado[24]'>" . "</TD>\n"); 
            print (
"<TD>" . "<input type='text' name='promfinal[]' size='3' value='$resultado[25]'>" . "</TD>\n"); 
Despues mira como se comportan en la pagina que lo envias updatenotas.php
Ejemplo

Código PHP:
<?php
foreach($_REQUEST as $k => $v){
  echo 
$k ." = ". $v."<br />";
}
?>
De esa forma vas a tener una idea de como trabajar los campos.

Me dejas saber