I am trying to subtract the value in the field directly in MySQL. I can add correctly as I have seen the correct updates. However I want to be able to store the negative of the value and not just keep itself at 0.
My query from PHP is as follow:
mysql_query("UPDATE registry SET npurchased = npurchased + '".$qty."', nremain = nremain - '".$qty."' WHERE regid = '".$regid."'" );
The MySQL field nremain is set as an unsigned int.
Please let me know where my problem lies.