$sql = "UPDATE vipcustomer SET points_forwarded='$cert_amountr WHERE custid=$uid";
is wrong so I removed the ' and now it will not change the database's amount for points_forwarded at all. It should read:
$sql = "UPDATE vipcustomer SET points_forwarded='$cert_amountr' WHERE custid=$uid";
Still the same result. I do now get the correct results for everything else. But the value always comes up 0.
$points_forwarded = number_format($points_forwarded);
was the evil code. . . but I still have my problem.