Please start new threads with new issues, so that users that might have the same problem can find them more easily and we don't dirty up threads with good questions and answers with unrelated issues.
I'm not sure how you would expect this page to work. You have a form with a single form element in it, but I don't think that form is ever submitted.
Did you want the value to be updated every time this page is accessed? Or did you have a link that adds the url parameter that triggers it?
My guess, without fully understanding the problem or what you are doing, is that you can fix the problem by:
1) deleting the form and hidden form element completely (it isn't doing anything)
2 updating this code:
<?php
if (WA_Auth_RulePasses("submitted")) {
$UpdateQuery = new WA_MySQLi_Query($RTMFi);
$UpdateQuery->Action = "update";
$UpdateQuery->Table = "enq_details";
$UpdateQuery->bindColumn("estimated_fee", "s", "".((isset($_POST["total_cost"]))?$_POST["total_cost"]:"") ."", "WA_DEFAULT");
$UpdateQuery->addFilter("enq_det_id", "=", "i", "".$_SESSION['enquiryDetID'] ."");
$UpdateQuery->execute();
$UpdateGoTo = "enquiry-list.php?redirect=yes";
if (function_exists("rel2abs")) $UpdateGoTo = $UpdateGoTo?rel2abs($UpdateGoTo,dirname(__FILE__)):"";
$UpdateQuery->redirect($UpdateGoTo);
}
?>
<?php
$totalCost = ($rsCalculate->getColumnVal('no_of_flats') * 75) + ($rsCalculate->getColumnVal('no_of_blocks') * 500);
?>
to:
<?php
$totalCost = ($rsCalculate->getColumnVal('no_of_flats') * 75) + ($rsCalculate->getColumnVal('no_of_blocks') * 500);
?>
<?php
if (WA_Auth_RulePasses("submitted")) {
$UpdateQuery = new WA_MySQLi_Query($RTMFi);
$UpdateQuery->Action = "update";
$UpdateQuery->Table = "enq_details";
$UpdateQuery->bindColumn("estimated_fee", "s", "".($totalCost) ."", "WA_DEFAULT");
$UpdateQuery->addFilter("enq_det_id", "=", "i", "".$_SESSION['enquiryDetID'] ."");
$UpdateQuery->execute();
$UpdateGoTo = "enquiry-list.php?redirect=yes";
if (function_exists("rel2abs")) $UpdateGoTo = $UpdateGoTo?rel2abs($UpdateGoTo,dirname(__FILE__)):"";
$UpdateQuery->redirect($UpdateGoTo);
}
?>
There is no need to use a hidden field or form at all, you can update the table with the calculation directly once you do the calculation above the update code.