I have the following code and when I submit it it does not update the NADA in the database.
$query = "SELECT * FROM tests WHERE ID = :ID";
$result = $db->prepare($query);
$result->execute(array(':ID' => $_REQUEST['ID']) );
if ($row = $result->fetch(PDO::FETCH_ASSOC)) {
?>
<br />
<br />
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<input id="Game" type="text" name="Name" value="<?php echo $row['Name]; ?>" required />
<br />
<input type="hidden" name="ID" value="<?php echo $row['ID']; ?>" />
<input type="Submit" name="Submit" value="Salvar alterações" />
</form>
<?
}
elseif (isset($_POST['Submit'])) {
$ID = $_POST['ID'];
$Name = $_POST['Name'];
$queryupdate = "UPDATE tests SET Name = :Name WHERE ID= :ID";
$q = $db->prepare($queryupdate);
$q->execute(array(":ID" => $ID, ":Name" => $Name));
header ('Location: edit.php');}