Ver Mensaje Individual
  #6 (permalink)  
Antiguo 16/07/2012, 18:03
Avatar de trofserpiente
trofserpiente
 
Fecha de Ingreso: julio-2012
Ubicación: Lerida
Mensajes: 220
Antigüedad: 12 años, 8 meses
Puntos: 1
Exclamación Respuesta: como insertar registros en masa

bueno su idea es buena pero el valor del input tipo text no lo envía y el del hidden si como hago gracias por su ayuda este es el código completo que estoy usando

Código PHP:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin título</title>
</head>
<?php 
$conexA
mysql_connect("localhost","root","malu1101")//conexión al servidor 
    
or die("No se pudo realizar la conexion"); 
$conexB=mysql_select_db("pruebas",$conexA)//elegir la base de datos 
    
or die("ERROR con la base de datos");
    
if(isset(
$_POST['a'])){    
$a=$_POST['a'];

$consulta="SELECT* FROM alumnos WHERE grado='".$a."'";
$resultado=mysql_query($consulta,$conexA);
 
echo 
'<table border="1">';
echo 
'<tr>';
echo 
'<th>'.'nombres'.'</th>';
echo 
'<th>'.'grado'.'</th>';
echo 
'<th>'.'Nota'.'</th>';
echo 
'<tr>';

while(
$fila=mysql_fetch_array($resultado))
{
echo 
'</tr>';
echo 
'<th>'.$fila['nombres'].'</th>';
echo 
'<th>'.$fila['grado'].'</th>';
echo 
'<form action="ingresar.php" method="post">';
echo 
'<td>'.'<input type="text" name="nota" />'.'</td>';
echo 
'<input type="hidden" name="id_estu" value="'.$fila['id'].'" />';

echo 
'</th>';
echo 
'<th>';
echo 
'</tr>';
}
echo 
'<input type="submit" value="aceptar"/>';
echo 
'</form>';
echo 
'</table>';
}
?>

<body>
<form action="alumconsul.php" method="post">
grado
<input type="text" name="a"/>
<input type="submit" value="enviar"/>
</form>
</body>
</html>
__________________
Luis Alfonso Cruz Valbuena
[email protected]