![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
06/06/2007, 10:25
|
| | Fecha de Ingreso: mayo-2006
Mensajes: 124
Antigüedad: 18 años, 8 meses Puntos: 0 | |
Re: hacer un array a partir de un $post <FORM ACTION="http://127.0.0.1/iaa/test2.php"
METHOD="POST" >
<?php
$result = mysql_query("SELECT alumnos.DNI, alumnos.Apellido, alumnos.Nombre, alumnos.Cohorte, alumnos.CAPS
from alumnos where alumnos.Universidad = $uni
and alumnos.cohorte = $cohorte
and alumnos.estado =1
order by 'DNI', 'Apellido'
", $link);
if ($row = mysql_fetch_array($result)){
echo "<table border = '4'> \n";
while ($field = mysql_fetch_field($result)){
echo "<table border = '1'> \n";
echo "<tr> \n";
}
echo "</tr> \n";
do {
echo "<tr> \n";
echo "<td width=58 color=#FFFFFF>".$row["DNI"]."</td> \n";
echo "<td width=142>".$row["Apellido"]."</td> \n";
echo "<td width=150>".$row["Nombre"]."</td> \n";
echo "<td width=25 >".$row["Cohorte"]."</td> \n";
echo "<td width=40 >".$row["CAPS"]."</td> \n";
mysql_query("INSERT INTO u".$_POST['uni']. "c" .$_POST['cohorte']. "m" .$_POST['modulo']. " (DNI) VALUES ('".$row['DNI']."')", $link);
$my_error = mysql_error($link);
echo $my_error;
?>
<td width="35" scope="col"><INPUT TYPE="int" NAME="nota" size= "2" maxlength ="2" > </td>
<?php echo "</tr> \n";
} while ($row = mysql_fetch_array($result));
echo "<table border = '1'> \n";
} else {
echo "Ha habido un error, por favor reintente";
}
mysql_free_result($result);
?>
<div align="right"><br> <br>
<INPUT TYPE="submit" value ="Enviar" >
ese es el codigo, esta bien? |