Ver Mensaje Individual
  #2 (permalink)  
Antiguo 13/03/2012, 10:45
Avatar de xxxivanxxx
xxxivanxxx
 
Fecha de Ingreso: julio-2010
Ubicación: /home
Mensajes: 114
Antigüedad: 13 años, 8 meses
Puntos: 21
Respuesta: Guardar el contenido de un array en una bd sql

hola, por que no insertas directamente dentro del while¿?

Código PHP:
Ver original
  1. while($rows=mysql_fetch_array($result))
  2. {
  3. $oxido[$i]=$rows["oxido"];
  4.  
  5. luego realizo otra consulta que me traiga el elemento correspondiente a cada oxido del arreglo y lo guarde en otro arreglo ($elemento)
  6.  
  7. $result1 = mysql_query("SELECT Elemento FROM oxidos WHERE Oxido = \"".$oxido[$i]."\"");
  8. $rows1=mysql_fetch_array($result1);
  9. $elemento=$rows1["Elemento"];
  10. $qry="INSERT INTO fuentes(Id, Calculado) VALUES (NULL, '".$elemento."')";
  11. mysql_query($qry);
  12. $i++;
  13. }
__________________
<?="Hello World"?> -> si te gustÓ dale +1