When executing this code, it indicates Undefined offset.
Doing a dump of variables, I discovered that the problem is in a checkbox $informarUP[$fila]
, that if it is selected it does not give the error and if it is not selected, it gives the error.
What I do not achieve is that the checkbox has a value if it is not selected.
<?php
//...
foreach($idfila as $fila) {
$pdesid = uniqid('pdes_');
if(isset($idfila)){
$queryPedidoDesglose = "INSERT INTO pedidos_desglose (id_pedido_desglose,id_pedido, id_pedido_trafico, direccion_inicio, hora_inicio, hora_inicio_hasta, descripcion, hora_rendicion, informar) VALUES ('$pdesid','$peid', '$id_pedido_nuevo', '$destino[$fila]', '$pedidohs[$fila]', '$pedidohshasta[$fila]', '$pedido_desarrollo[$fila]', '$rendicionhs[$fila]', '$informarUP[$fila]')";
if ($mysqli->query($queryPedidoDesglose) === TRUE){};
//...
}
}
?>