I have made this piece of code to manage counter cash on a shop, the user enters the new balance in the input field and presses the enter button. The code updates the database but it does not update the browser input field accordingly. We have to refresh the page (Using F5 or relaod button in the browser) in order to see the updated cash value. Please help me to enter the new value and the page displays the new updated value instantly.
<?php
$cash_query = mysqli_query($link,"SELECT * FROM aks_counter");
while ($counter_row = mysqli_fetch_array($cash_query))
{
$counter_cash = $counter_row['counter_cash'];
?>
<div class="container">
<div id="counter_cash">
<form method="POST">
<input type="number" name="counter_balance" class="input_field" value="<?php echo $counter_cash; ?>">
<input type="hidden" name="counter_hidden_id" value="<?php echo $counter_row['id']; ?>">
</form>
<?php
}
$counter_id = $_POST['counter_hidden_id'];
$counter_balance = $_POST['counter_balance'];
mysqli_query($link,"UPDATE aks_counter SET counter_cash=$counter_balance WHERE id=$counter_id");
?>
 
<h2>Counter Cash</h2>
</div>
</div>