Ver Mensaje Individual
  #4 (permalink)  
Antiguo 12/06/2011, 22:50
Avatar de gildus
gildus
 
Fecha de Ingreso: agosto-2003
Mensajes: 1.495
Antigüedad: 20 años, 8 meses
Puntos: 105
Respuesta: error al actualizar los datos

Holas,

A simple vista, veo que estas haciendo un bucle:

Código PHP:
Ver original
  1. <?php do { ?>
  2. <table border="1">
  3. <tr>
  4. <td><input name="id" type="text" id="id" value="<?php echo $row_Recordset['id']; ?>" size="5"></td>
  5. <td><input name="Nombre_de_la_Pagina" type="text" id="Nombre_de_la_Pagina" value="<?php echo $row_Recordset['Nombre_de_la_Pagina']; ?>"></td>
  6. <td><input name="Descripcion" type="text" id="Descripcion" value="<?php echo $row_Recordset['Descripcion']; ?>"></td>
  7. <td><input name="Fecha" type="text" id="Fecha" value="<?php echo $row_Recordset['Fecha']; ?>"></td>
  8. <td><input name="Direccion_Url" type="text" id="Direccion_Url" value="<?php echo $row_Recordset['Direccion_Url']; ?>"></td>
  9. <td><input name="Hipervinculo" type="text" id="Hipervinculo" value="<?php echo $row_Recordset['Hipervinculo']; ?>"></td>
  10. <td><input name="Usuario" type="text" id="Usuario" value="<?php echo $row_Recordset['Usuario']; ?>"></td>
  11. <td><input name="Password" type="text" id="Password" value="<?php echo $row_Recordset['Password']; ?>"></td>
  12. </tr>
  13. </table>
  14. <?php } while ($row_Recordset = mysql_fetch_assoc($Recordset)); ?>

Alli imprimes varios input con el mismo nombre de variable, es por eso que cuando envias o haces el submit al recogerlos en el servidor solo capturas los ultimos valores.

No crees que mejor lo harias asi:


Código PHP:
Ver original
  1. <?php
  2. $i=0;
  3. do { ?>
  4. <table border="1">
  5. <tr>
  6. <td><input name="id<? echo $i;?>" type="text" id="id" value="<?php echo $row_Recordset['id']; ?>" size="5"></td>
  7. <td><input name="Nombre_de_la_Pagina<? echo $i;?>" type="text" id="Nombre_de_la_Pagina" value="<?php echo $row_Recordset['Nombre_de_la_Pagina']; ?>"></td>
  8. <td><input name="Descripcion<? echo $i;?>" type="text" id="Descripcion" value="<?php echo $row_Recordset['Descripcion']; ?>"></td>
  9. <td><input name="Fecha<? echo $i;?>" type="text" id="Fecha" value="<?php echo $row_Recordset['Fecha']; ?>"></td>
  10. <td><input name="Direccion_Url<? echo $i;?>" type="text" id="Direccion_Url" value="<?php echo $row_Recordset['Direccion_Url']; ?>"></td>
  11. <td><input name="Hipervinculo<? echo $i;?>" type="text" id="Hipervinculo" value="<?php echo $row_Recordset['Hipervinculo']; ?>"></td>
  12. <td><input name="Usuario<? echo $i;?>" type="text" id="Usuario" value="<?php echo $row_Recordset['Usuario']; ?>"></td>
  13. <td><input name="Password<? echo $i;?>" type="text" id="Password" value="<?php echo $row_Recordset['Password']; ?>"></td>
  14. </tr>
  15. </table>
  16. <?php
  17.     $i++;
  18. } while ($row_Recordset = mysql_fetch_assoc($Recordset)); ?>


Saludos
Gildus
__________________
.: Gildus :.