Ver Mensaje Individual
  #6 (permalink)  
Antiguo 28/02/2014, 15:33
Avatar de andresgarciadev
andresgarciadev
 
Fecha de Ingreso: junio-2013
Mensajes: 218
Antigüedad: 10 años, 10 meses
Puntos: 32
Respuesta: Si mi select es igual a 0 no insertar

creo q no entendiste lo que dijo xpapachox XD
Se referia a en este orden

Código PHP:
Ver original
  1. <?php require_once('connection.php');
  2.  
  3. mysql_select_db($database_connection, $connection);
  4. for($i=1;$i<=3;$i++){
  5.     $valor_select = $_POST["select$i"];
  6.    if($valor_select==0){
  7.     break;
  8.    }else{  
  9.    $input_a = $_POST['input$i']
  10.    $input_b = $_POST['input0$i']
  11. $update=mysql_query("INSERT INTO probando (seleccion,texto) VALUES ('$input_a','$input_b')");
  12.  }      
  13.  
  14. header("location: Index.htm");