Saludos
Revisa el siguiente código lo hice de rapidez asi qeu puede tener errores de sintaxys, pero la idea espero se entienda
Código PHP:
Ver original<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf8">
<title>UN EJEMPLO</title>
</head>
<body>
<?php
//Nos conectamos a la base de datos
$bd_host = "localhost";
$bd_usuario = "mario";
$bd_password = "1985";
$bd_base = "anime";
//Indicamos sobre que boton viene el formulario
if ($POST['boton'] == "ACTUALIZAR") {
//Convertimos los datos del formulario a cadenas.
$nombreact = $_POST['nombreact']; // nombre del valor se va actualizar
$nombreant = $_POST['nombreant']; // nombre anterior
$descripccion = $_POST['descripccion'];
$imagen = $_POST['imagen'];
$estado = $_POST['estado'];
//NANO Manejo de errores por si se llega a ejecutar mal la consulta mysql_error
nombre='$nombreact',
descripccion='$descripccion',
imagen='$imagen',
estado='$estado'
WHERE nombre='nombreant'", $conexion) or
die("Error En la actualizacion" . mysql_error()); } elseif($POST['boton']== "ENVIAR") {
//Si el boton es enviar realizamos la consulta y generamos el formulario
$nombre = $_POST['nombre'];
$resultados = mysql_query("SELECT * FROM animes WHERE nombre LIKE '%$nombre%'", $conexion) or
die("Error En la consulta" . mysql_error()); ?>
<table border=1 cellspacing=1 cellpadding=1>
<tr>
<td><b>NOMBRE</b></td>
<td><b>descripccion</b></td>
<td><b>imagen</b></td>
<td><b>estado</b></td>
</tr>";
<?php
//Creamos el bucle para los resultados
//Creamos un campos hidden que va ser oculto este va contener el valor real que es el que se va actualizar
?>
<form action="ejemplo.php" method ="post">
<tr>
<td><input type="hidden" name="nombreant" size="20" maxlength="30" value="<?php echo $row[nombre]; ?>">
<input type="text" name="nombreact" size="20" maxlength=30 value="<?php echo $row[nombre]; ?>"></td>
<td><input type="text" name="dire" size="20" maxlength=30 value="<?php echo $row[descripccion]; ?>"></td>
<td><input type="text" name="tel" size="20" maxlength=30 value="<?php echo $row[imagen]; ?>"></td>
<td><input type="text" name="email" size="20" maxlength=30 value="<?php echo $row[estado]; ?>"></td>
<td><input type="submit" name="boton" value="ACTUALIZAR"></td>
</tr>
</form>
<?php
}
?>
</table>
<?php
}
//Cerramos la conexión con MySQL
?>
<small>INGRESE SUS DATOS</small><br>
<form action="ejemplo.php" method ="post">
<input type="text" name="nombre" size="20" maxlength="30">
<input type="submit" name="boton" value="ENVIAR">
</form><br>
</body>
</html>