Ver Mensaje Individual
  #6 (permalink)  
Antiguo 06/06/2011, 16:55
Avatar de the_web_saint
the_web_saint
 
Fecha de Ingreso: mayo-2008
Ubicación: localhost/tierra/america/panama
Mensajes: 1.229
Antigüedad: 16 años
Puntos: 43
Respuesta: Consulta y Actualizacion en 1 text

Hola te recomiendo dos archivos:

Primero algo que tenga esto:
Código PHP:
Ver original
  1. <?php
  2.  
  3. include('establecer_conexion.php');
  4.  
  5. $link = conexion();
  6.  
  7.  
  8. $cedula = $_POST["cedula"];
  9.  
  10. $result = mysql_query ("select * from empleado where ci_empleado = '$cedula'", $link);
  11.  
  12.  
  13. $row = mysql_fetch_array($result);
  14. ?>
  15.  
  16. <form id="form2" name="form2" method="post" action="archivo2.php">
  17. <table>
  18.  
  19. <th><input type="text" name="nombre" value="<?php echo $row["nombre"]; ?>"/>
  20. <input type="hidden" name="cedula" value="<?php echo $cedula; ?>"/>
  21. </th>
  22. <th><input type="submit" name="Submit" value="enviar" /></th>
  23.  
  24. </table>
  25.  
  26. </form>

El segundo que contenga esto:
Código PHP:
Ver original
  1. <?php
  2. include('establecer_conexion.php');
  3.  
  4. $link = conexion();
  5.  
  6.  
  7. $cedula = $_POST["cedula"];
  8. $nombre = $_POST["nombre"];
  9.  
  10. $result = mysql_query ("update empleado set nombre = '$nombre' where ci_empleado = '$cedula'");
  11. ?>

Me comentas que tal te va.

Slds
__________________
..::The Saint::..
El pesimista se queja del viento; el optimista espera que cambie; el realista ajusta las velas.

Última edición por the_web_saint; 06/06/2011 a las 16:55 Razón: Más...