On one page I have a material registration form, in another I have a table that shows all the materials registered with a button to change the information about a material and this button opens a third page with the same form of the first one only page that already filled with the information just for you to change.
But when I change the information and click to save, the saved script appears and it does not change the information.
This is my edit form:
<?php
require 'strcon.php';
$query = mysqli_query($strcon, "SELECT MATERIAL FROM materiais");
$material = filter_input(INPUT_POST, 'MATERIAL');
$quantidade = filter_input(INPUT_POST, 'QUANTIDADE');
$id = filter_input(INPUT_POST, 'ID');
?>
<!-- formulário -->
<form method="POST" action="update-est.php">
<div class="container">
<div class="row">
<div class="col-lg-8 col-md-10 mx-auto">
<div class="form-group">
<label for="MATERIAL">Material:</label>
<input type="text" class="form-control" id="MATERIAL" name="MATERIAL" value="<?php echo $material; ?>">
</div>
<div class="form-group">
<label for="QUANTIDADE">Quantidade:</label>
<input type="text" class="form-control" id="QUANTIDADE" name="QUANTIDADE" value="<?php echo $quantidade;?>">
</div>
<button type="submit" class="btn btn-primary btn-lg btn-block">Salvar</button>
</div>
</div>
</div>
</form>
<hr>
And this is my update:
<!--Update Estoque-->
<?php
$quantidade = filter_input(INPUT_POST, 'QUANTIDADE');
$id = filter_input(INPUT_POST, 'ID');
$strcon = mysqli_connect('localhost', 'root', '', 'sis_tam') or die('Erro ao conectar ao banco de dados');
$sql = "UPDATE 'sis_tam'.'materiais' SET 'QUANTIDADE' = '$quantidade' WHERE 'materiais'.'ID' = '$id' ";
mysqli_query($strcon,$sql) or die("Erro ao tentar atualizar registro. " . mysqli_error($strcon));
mysqli_close($strcon);
echo '<script type="text/javascript">
alert("Salvo com Sucesso !");
window.history.go(-1);
</script>';
?>
Can anyone identify why this is happening?