Probé de la siguiente manera:
Cita:
Código PHP:
Ver original<?php
include("conexion.php");
$id = $_GET['id_producto'];
$nombre = $_POST['nombre'];
$consulta = "SELECT * FROM productos WHERE id_producto=$id";
if(isset($_POST["enviar"])){ $consulta = "UPDATE productos SET nombre='$nombre' WHERE id_producto=$id";
echo "Los datos fueron actualizados con éxito!.\n";
} else {
?>
<form action="modifica.php" method="post">
<input name="nombre" type="text" value="<?php echo $fila["nombre"]; ?>">
<input type="submit" value="Guardar Cambios" name="enviar">
</form>
<?php
}
?>
Pero me sigue dando el error:
Cita: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
Se les ocurre alguna solución?
Muchas gracias!