Ver Mensaje Individual
  #1 (permalink)  
Antiguo 29/09/2010, 05:09
Vuguma
 
Fecha de Ingreso: septiembre-2010
Ubicación: Pontevedra
Mensajes: 8
Antigüedad: 14 años, 5 meses
Puntos: 0
Update de campos dinamicos

Hola, soy nueva en este foro. Primero os saludo a todos y ahora os hago una consulta: tengo un formulario con una tabla que se crea de forma dinamica con una consulta a la base de datos mysql a traves de un do....while...
Hasta aqui todo bien porque me muestra todos los registros de la consulta, el problema esta en que cuando quiero hacer un update de estos registros no se como se llaman los campos, como puedo identificarlos?

Código PHP:
 <?php 
    
do {     
    
?>
    <tr>
    <td><input name="txt_desde" type="text" id="txt_desde" tabindex="7" onKeyUp="this.value=formateafecha(this.value);" value="<?php echo  implode'/'array_reverseexplode'-'$row_grid['desde'] ) ) ); ?>"></td>
    <td><input name="txt_hasta" type="text" id="txt_hasta" tabindex="8" onKeyUp="this.value=formateafecha(this.value);" value="<?php echo  implode'/'array_reverseexplode'-'$row_grid['hasta'] ) ) ); ?>"></td>
    
    <td width="50"><select name="cbo_reg" class="cbo_ancho100" id="cbo_reg" tabindex="10">
      <option value="1" selected <?php if (!(strcmp(1$row_grid['reg']))) {echo "selected=\"selected\"";} ?>>SA</option>
      <option value="2" <?php if (!(strcmp(2$row_grid['reg']))) {echo "selected=\"selected\"";} ?>>HD</option>
      <option value="3" <?php if (!(strcmp(3$row_grid['reg']))) {echo "selected=\"selected\"";} ?>>MP</option>
<option value="4" <?php if (!(strcmp(4$row_grid['reg']))) {echo "selected=\"selected\"";} ?>>PC</option>
    </select></td>
    <td><input name="txt_importe" type="text" id="txt_importe" tabindex="11" onKeyUp="revisaCadena(this)" value="<?php echo $row_grid['importe']; ?>" size="15"></td>
    <td width="28" align="center"><input <?php if (!(strcmp($row_grid['ck_L'],1))) {echo "checked=\"checked\"";} ?> type="checkbox" name="ck_L" id="ck_L" tabindex="12"></td>
    <td width="28" align="center"><input <?php if (!(strcmp($row_grid['ck_M'],1))) {echo "checked=\"checked\"";} ?> type="checkbox" name="ck_M" id="ck_M" tabindex="13"></td>
    <td width="28" align="center"><input <?php if (!(strcmp($row_grid['ck_X'],1))) {echo "checked=\"checked\"";} ?> type="checkbox" name="ck_X" id="ck_X" tabindex="14"></td>
    <td width="28" align="center"><input <?php if (!(strcmp($row_grid['ck_J'],1))) {echo "checked=\"checked\"";} ?> type="checkbox" name="ck_J" id="ck_J" tabindex="15"></td>
    <td width="28" align="center"><input <?php if (!(strcmp($row_grid['ck_V'],1))) {echo "checked=\"checked\"";} ?> type="checkbox" name="ck_V" id="ck_V" tabindex="16"></td>
    <td width="28" align="center"><input <?php if (!(strcmp($row_grid['ck_S'],1))) {echo "checked=\"checked\"";} ?> type="checkbox" name="ck_S" id="ck_S" tabindex="17"></td>
    <td width="32" align="center"><input <?php if (!(strcmp($row_grid['ck_D'],1))) {echo "checked=\"checked\"";} ?> type="checkbox" name="ck_D" id="ck_D" tabindex="18">
      <input name="id_tar_grid" type="hidden" id="id_tar_grid" value="<?php echo $row_grid['id_tarifa_grid']; ?>" size="2"></td>
  </tr>
  <?php } while ($row_grid mysql_fetch_assoc($grid)); ?>