Código PHP:
$rs = mysql_query("select Nombre, Apellido, Direccion, Telefono from datos where Id = $id");
cuando lo pongo asi...
Código PHP:
$rs = mysql_query("select Nombre, Apellido, Direccion, Telefono from datos where Id = '$id'");
Código PHP:
$rs = mysql_query("select Nombre, Apellido, Direccion, Telefono from datos where Id");
mi idea es que los datos que envio por un formulario los muestre y se puedan modificar...,
tienen idea que puede ser?
este es el formulario que muestra y envia la informacion....
Código PHP:
[HTML] <?php
include ('conexion.php');
$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 ?>"><? echo $Id; ?></a></td>
<td><? echo $Nombre; ?></td>
<td><? echo $Apellido; ?></td>
<td><? echo $Direccion; ?></td>
<td><? echo $Telefono; ?></td>
</tr>
<?
}
?>
</table> [/HTML]
Código PHP:
[HTML]<?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");
list($nombre,$apellido,$direccion,$telefono) = mysql_fetch_row($rs);
?>
<h2>Actualiza Cliente <?= $nombre ?></h2>
<a href="actualizar.php?id=<?= $id ?>">Actualiza</a>
<br>
<br>
<form action="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>[/HTML]