please i am updating a data in the table outstanding, but the page needs to be refreshed before it displays the update for $row[‘obal’] , any help or clue
<tr>
<th>TO BALANCE</th>
<th><?php
$tobal = ($totalprice-$partpayment);
echo $tobal;
if ($tobal!=0)
{
$pplresult = mysql_query("SELECT * FROM outstanding WHERE Uname = '{$_SESSION['username']}'") or die(mysql_error());
$row = mysql_fetch_assoc($pplresult);
$query = mysql_query("
UPDATE outstanding
SET outstandingbal = '$tobal'
WHERE outstandingbal='{$row['outstandingbal']}'
AND
Uname = '{$_SESSION['username']}'
") or die(mysql_error());
}
?></th>
</tr>
[B] <tr>
<th>OUTSTANDING</th>
<th><?php
$pplresult = mysql_query("SELECT * FROM outstanding WHERE Uname = '{$_SESSION['username']}'") or die(mysql_error());
$row = mysql_fetch_assoc($pplresult);
//echo $obal;
// echo $row['obal'];
if($totalprice==0){
$queryreg = mysql_query("
UPDATE outstanding
SET obal = '{$row['outstandingbal']}'
WHERE obal='{$row['obal']}'
AND
Uname = '{$_SESSION['username']}'
") or die(mysql_error());
echo $row['obal']; }
else{
echo $row['obal'];
}
?></th>
</tr>[/B]
<tr>