Siguiendo la lógica que me plantearon en todo el post debería funcionar así:
Cita:
Código PHP:
Ver original<?php
include("conexion.php");
if(isset($_POST["enviar"])){ $id = $_GET['id_producto'];
$consulta = "UPDATE productos SET nombre='$nombre' WHERE id_producto=$id";
echo "Los datos fueron actualizados con éxito!.\n";
} else {
$id = $_GET['id_producto'];
$consulta = "SELECT * FROM productos WHERE id_producto=$id";
?>
<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
}
?>
Dado que ahí vuelvo a obtener el $ID.
Pero sigo teniendo el error de sintaxis:
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
Me podrán ayudar?
Muchas gracias!