I can't get this to work. Shouldn't the colname be in the WHERE clause? available_inventory is coming up as unknown column.
Also, I'm not sure how to ensure that the posted element listed is the element with the quantity that the user enters which checks on the available quantity minus the quantity that the user is trying to add.