I am trying to make a program that will check the remaining number of an item left in stock and that will, if someone buys it, subtract the amount of the item bought and then re-write it into the database... (Something like what they use in some stores)
How do I do this?