Jump to content

[SOLVED] Integer doesnt subtract fully


SirChick

Recommended Posts

I have a variable set at 10,800 and im trying to subtract it in my query like here:

$Price = 10,800 in this example.

 

$subtractMoney = "UPDATE userregistration SET MoneyInHand=MoneyInHand-'$Price' WHERE UserID='{$_SESSION['Current_User']}'";
		$result = mysql_query($subtractMoney) or die(mysql_error());
		if (mysql_affected_rows() == 0)
		{
		die('Error ID 0001A, contact admin on the forums immediately about this error!');
		}

 

But the subtraction is only going down by 10. Not 10,800.. although this 10,800 could be any value this was what i used for this example.

Link to comment
https://forums.phpfreaks.com/topic/74515-solved-integer-doesnt-subtract-fully/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.