Muestro al usuario....
Código PHP:
<?php
include ('conexion.php');
echo '<p>'."muestra usuarios";
$rs = mysql_query("select Id, Nombre , Apellido, Direccion, Telefono from datos");
?>
<table border="1">
<tr>
<th>Id</th>
<th>Nombre</th>
<th>Apellido</th>
<th>Direccion</th>
<th>Telefono</th>
</tr>
<?php
while (list($Id, $Nombre, $Apellido, $Direccion, $Telefono) = mysql_fetch_row($rs)) {
?>
<tr>
<td><a href="actualiza_usuario.php?id= <?= $Id ?>"><?= $Id ?></td>
<td><?= $Nombre ?></td>
<td><?= $Apellido ?></td>
<td><?= $Direccion ?></td>
<td><?= $Telefono ?></td>
</tr>
<?
}
?>
</table>
<form action="actualiza_usuario.php?id=" method="post">
<input type="submit" value="actualizar usuario" />
</form>
actualizar_usuario.php
Código PHP:
<?php
include ('conexion.php');
echo '<p>';
echo 'actualiza usuario'.'<p>';
// $rs = mysql_query("select Nombre, Apellido, Direccion, Telefono from datos where Id = $id");
$rs = mysql_query("select Nombre, Apellido, Direccion, Telefono from datos where Id='$id'");
list($nombre,$apellido,$direccion,$telefono) = mysql_fetch_row($rs);
?>
<?php echo $nombre ?>
<h2>Actualiza Cliente <?= $nombre ?></h2>
<a href="actualizar.php?id=<?= $id ?>">Actualiza</a>
<br>
<br>
<form action="cliente_actualizar.php" method="post">
<input type="hidden" name="id" value="<?= $id ?>">
<table>
<tr>
<td>Id</td>
<td><?= $id ?></td>
</tr>
<tr>
<td>Nombre</td>
<td><input type="text" name="nombre" value='<?= $nombre ?>'></td>
</tr>
<tr>
<td>apellido</td>
<td><input type="text" name="apellido" value='<?= $apellido?>'></td>
</tr>
<tr>
<td>direccion</td>
<td><input type="text" name="direccion" value='<?= $direccion?>'></td>
</tr>
<tr>
<td valign="top">telefono</td>
<td>
<input type="text" name="telefono" value='<?= $telefono ?>'>
</td>
</tr>
</table>
<input type="submit" value="Aceptar">
</form>
Código PHP:
include ('conexion.php');
echo '<p>';
echo 'actualiza usuario';
echo '<p>';
$sql= "uptdate datos from Nombre ='$nombre' , Apellido ='$apellido', Direccion ='$direccion' , Telefono ='$telefono' ,
where Id =$id ";
mysql_query($sql);
if ( $sql == flase ){
echo "salio algo mal ";
}
?>
agredacere su ayuda
GRACIAS
DAnte