Código:
y al avis10g.php debe recoger la lista de idavis[] i executa[] para actualizar<form id="fexecucio" name="fexecucio" action="avis10g.php" method="post"> <button type='submit' class='btn btn-primary text-uppercase col-md-offset-10'>Actualizar estado</button> <table id="taulaavisos" class="table table-striped table-bordered table-hover table-green"> $sql = "select *, ISNULL(dataAgeAvis) from avisos_view, obres where idObra = obraAvis $sqlwhereoper $sqlwheretanc $sqlwheremotiu order by ISNULL(dataAgeAvis) asc, dataAgeAvis, horaageavis asc"; $result = mysql_query($sql) or die ($sql); while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { ?> <tr> <td> <div class="form-group"> <div> <?php $cbexecuta=''; if ($row['enexecucioAvis'] == 'Y') $cbexecuta='checked'; ?> <input class="form-control input-sm" type="hidden" value="<?php echo $row['idAvis'] ?>" name="idavis[]" id="idavis[]" /> <input class="form-control input-sm" <?php echo $cbexecuta ?> type="checkbox" value="Y" name="executa[]" id="executa[]" /> </div> </div> </td>
Código:
Como debo hacer para recorrer la lista de valores de idavis i executa par actualizar la BBDD? <?php include("inc/seguretat.php"); ?> <?php include('inc/connect.php'); ?> <?php $contador=0; foreach ($_POST['$idavis'] as $idavis){ $valorcb=$_post[$executa[$contador]]; echo "<br> [".$idavis."][".$valorcb."]"; $contador++; }