Consider the following sql statement in PHP:
UPDATE table SET balance = $sum - $amountwhat if $amount less than zero
UPDATE table SET balance = 50 - -10-- means comment, no -- equals to + in SQL
and what we have is not what we wanted - every record with balance = 50
That was my epic production fail. Backup and stored balance transactions records saved my day.
Don't use such stupid statements...