El codigo esta dividido en dos partes.
1-actualiza.php :recive los datos en formulario y tiene una tabla con una select y los muestra en la misma pag.
2-procesa_actualizar.php :Procesa el update, con los datos que se le envian desde actualizar.php
Debe ser algun error tonto mio, que no lo pillo
actualizar.php
Código PHP:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento sin título</title>
</head>
<body>
<FORM ACTION="procesa_actulizar.php">
<TABLE>
<TR>
<TD>Rut:</TD>
<TD><INPUT TYPE="text" NAME="caja_rut" SIZE="20" MAXLENGTH="30"></TD>
</TR>
<TR>
<TD>Nombre:</TD>
<TD><INPUT TYPE="text" NAME="caja_nombre" SIZE="20" MAXLENGTH="30"></TD>
</TR>
<TR>
<TD>Apellido:</TD>
<TD><INPUT TYPE="text" NAME="caja_apellido" SIZE="20" MAXLENGTH="30"></TD>
</TR>
</TABLE>
<INPUT TYPE="submit" NAME="accion" VALUE="Actualizar">
</FORM>
<?php
include("conex.php");
$link=Conectarse();
$result=mysql_query("select * from cliente",$link);
?>
<hr />
<center> <p>Registros Base de Datos </p></center>
<TABLE BORDER=1 CELLSPACING=1 CELLPADDING=1 align="center"> <TR><TD> Rut</TD><TD> Nombre </TD><TD> Apellido </TD></TR>
<?php
while($row = mysql_fetch_array($result)) {
printf(" <tr><td> %s</td> <td> %s </td> <td> %s </td></tr>",$row["rut_cliente"],$row["nom_cliente"], $row["ape_cliente"]);
}
mysql_free_result($result);
mysql_close($link);
?>
</table>
</body>
</html>
Código PHP:
<?php
ob_start();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento sin título</title>
</head>
<body>
<?php
include("conex.php");
$link=Conectarse();
$id=$_GET['caja_rut'];
mysql_query("update cliente set rut_cliente='$caja_rut',nom_cliente='$caja_nombre',ape_cliente='$caja_apellido'
where(rut_cliente = '$id')",$link);
header("Location: actualizar.php");
?>
</body>
<?php
ob_end_flush();
?>
</html>