I have to use this code, I do not have another option, I do not find how to make the assignment in the UPDATE receiving the input data
$id = $_POST["id"];
$nombre = $_POST["nombre"];
$categoria = $_POST["categoria"];
$precio = $_POST["precio"];
$sql = "UPDATE 'revistas' SET 'nombre'= ".$nombre." , 'categoria' = ".$categoria.", 'precio' =". $precio." WHERE 'id' =". $id;
$affectedrows = $db->exec($sql);
if(isset($affectedrows)) {
echo "Record has been successfully updated";
}
ORIGINAL CODE
$sql = "UPDATE 'vehiculo' SET 'modelo'= 'Gol' , 'modelo' = '2018' ,'kilometros' = '10' WHERE 'id' = 2" ;
$affectedrows = $db->exec($sql);
if(isset($affectedrows)) {
echo "Record has been successfully updated";
}