Add another condition to update only if the field is greater 0
UPDATE your_table
SET field = field - 1
WHERE id = $number
AND field > 0
Add another condition to update only if the field is greater 0
UPDATE your_table
SET field = field - 1
WHERE id = $number
AND field > 0