![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
04/06/2007, 13:45
|
| | Fecha de Ingreso: mayo-2006
Mensajes: 124
Antigüedad: 18 años, 8 meses Puntos: 0 | |
Duda con fetch array e insert de nuevo yo, necesitaria si alguien puede decirme donde esta mi error:
<?php
$link = mysql_connect("localhost","root","");
mysql_select_db("medcom");
$result = mysql_query("SELECT alumnos.DNI
from alumnos where alumnos.Universidad = 6
and alumnos.cohorte = 2
and alumnos.estado =1
", $link);
while($row = mysql_fetch_array($result)) {
echo $row["DNI"];
/* }
foreach ($result as $value) { */
mysql_query("INSERT INTO iaa (DNI) VALUES ('".$row."')", $link);
}
mysql_free_result($result);
?>
Pero me agrega todos 0 en la tabla... donde esta mi error??????? |