On my system there is a page with a form that registers an order and another page with a table that shows all the records of registered orders.
In each row of the table has a request and an edit button that opens a form equal to that used in the order form that should be filled with the information registered.
This is the edit button:
// Adicionando botão de exclusão
$table .= '<td><form action="FormEdicao.php" method="post">';
$table .= '<input type="hidden" name="ID" value="'.$r['ID'].'">';
$table .= '<input type="hidden" name="CLIENTE" value="'.$r['CLIENTE'].'">';
$table .= '<input type="hidden" name="SERVICO" value="'.$r['SERVICO'].'">';
$table .= '<input type="hidden" name="SOLICITACAO" value="'.$r['SOLICITACAO'].'">';
$table .= '<input type="hidden" name="PREVISAO" value="'.$r['PREVISAO'].'">';
$table .= '<input type="hidden" name="VALOR" value="'.$r['VALOR'].'">';
$table .= '<button class="btn btn-primary"><i class="glyphicon glyphicon-pencil"> Editar </i></button>'; //aqui está o seu botão
$table .= '</form></td>';
}
This is the editing form:
<?php
require 'strcon.php';
$query = mysqli_query($strcon, "SELECT SERVICO FROM pedidos");
$cliente = filter_input(INPUT_POST, 'CLIENTE');
$servico = filter_input(INPUT_POST, 'SERVICO');
$solicitacao = filter_input(INPUT_POST, 'PREVISAO');
$valor = filter_input(INPUT_POST, 'VALOR');
$id = filter_input(INPUT_POST, 'ID');
?>
<!-- formulário de edição -->
<form method="POST" action="update-ped.php">
<div class="container">
<div class="row">
<div class="col-lg-8 col-md-10 mx-auto">
<div class="form-group">
<label for="CLIENTE">Cliente:</label>
<input type="text" class="form-control" id="CLIENTE" name="CLIENTE" value="<?php echo $cliente; ?>">
</div>
<div class="form-group">
<label for="SERVICO">Serviço:</label>
<input type="text" class="form-control" id="SERVICO" name="SERVICO" value="<?php echo $servico; ?>">
</div>
<div class="form-group">
<label for="SOLICITACAO">Data de solicitação:</label>
<input type="text" class="form-control" id="SOLICITACAO" name="SOLICITACAO" value="<?php echo $solicitacao; ?>">
</div>
<div class="form-group">
<label for="PREVISAO">Data prevista:</label>
<input type="text" class="form-control" id="PREVISAO" name="PREVISAO" value="<?php echo $previsao; ?>">
</div>
<div class="form-group">
<label for="VALOR">Valor:</label>
<input type="text" class="form-control" id="VALOR" name="VALOR" value="<?php echo $valor; ?>">
</div>
<button type="submit" class="btn btn-primary btn-lg btn-block">Salvar</button>
</div>
</div>
</div>
</form>
But for some reason these fields that should be filled are not, follow the images to facilitate: