Ver Mensaje Individual
  #3 (permalink)  
Antiguo 26/11/2013, 08:59
martin_9_91
 
Fecha de Ingreso: mayo-2011
Ubicación: Bs.As Argentina
Mensajes: 193
Antigüedad: 13 años
Puntos: 3
Respuesta: Ingreso múltiple mysql

Proba esto:

Código PHP:
Ver original
  1. <?php
  2. for($i=0;$i<=30;$i++){
  3. $uno = "'" . $_POST['dato1'][$i] . "'";
  4. $dos = "'" . $_POST['dato2'][$i] . "'";
  5. $tres = "'" . $_POST['dato3'][$i  "'";  
  6. $conexion=mysql_connect('localhost','root','') ;
  7. mysql_select_db('basededatos',$conexion) ;
  8.    
  9. $consulta = "insert into tabla (campo1, campo2, campo3)
  10. VALUES ($uno,$dos,$tres)";
  11.  
  12. $resultado = mysql_query($consulta,$conexion) or die (mysql_error());
  13.  
  14. echo "<script>alert('Almacenado');</script>";    
  15.     header("Location:ingreso2.php");
  16.  
  17. mysql_close($conexion);}
  18.  
  19. ?>