When I run this code, the "INSERT INTO aks_balance_history" query and "UPDATE aks_account" query runs again and again.Also database is getting updated on each refresh, while the "UPDATE aks_counter" runs only once (as required). I am really stuck in this code please help.
if(isset($_POST['update_btn_counter']))
{
mysqli_query($link,"INSERT INTO aks_balance_history(bh_amount,bh_from,bh_to,bh_reason) VALUES('".$_POST["used_balance"]."','Counter Cash','".$_POST["select_account"]."','".$_POST["reason"]."') ");
mysqli_query($link,"UPDATE aks_counter SET counter_balance = counter_balance - '$_POST[used_balance]' WHERE counter_id='0' ");
mysqli_query($link,"UPDATE aks_account SET account_balance = account_balance + '$_POST[used_balance]' WHERE account_title='$_POST[select_account]' ");
}