Hi guys,

I need some help with the following code. I am sure I have the right variable and checked using

Code:
	echo "<h1>Post Parameter/s:</h1>";
	echo "<pre>";
	if($_POST)
		print_r($_POST);
	else
		echo "There are no post parameters.";
	echo "</pre>";
so the post comes back as value "transamt"

I wrote the following code to capture the payment info but I can't get it to update MySQL. HELP!!!

Code:
$result=mysql_query("SELECT user,money from chatusers WHERE id='$_COOKIE[id]' LIMIT 1");

	while($row = mysql_fetch_array($result)) 

	{	$username=$row['user'];$money=$row['money'];	}
if (strstr($_POST['transamt'],".") == "")
	{
echo $money=$money + $_POST['transamt'].".00";
	}
	else 
	{
	$money=$money + $_POST['transamt'];	
	} 	
			$sql="Update chatusers set money=$money where user='$username'";
			 $res=mysql_query($sql);
	mysql_query("insert into payments (ammount, details) values ('".$_POST['transamt']."', '$username')");
	echo '<script>window.location="buyminutes.php"</script>';