I have the following script
Code: Select all
$query6="UPDATE table SET deduction = deduction + $amount, balance = balance - $amount WHERE number=$number";
if ($a == $b)
{
mysql_query($query6, $link) or die("query 6 has failed - " . mysql_errno() . ": " .
mysql_error());
echo "\$$amount was deducted from the district's balance. <br>\n";
} else {
echo "The balance for district $number was not changed. <br>\n";
}