Mysql, run a transaction query

(Asdar) #1

Hi,
I need to accept transaction in my chatbot.
The transaction includes some queries before and after the money movement takes place.
In mysql there is the query “start transaction” and “commit” that help me to avoid that there are only half transactions if there were problems during the transaction.
Unfortunately, I get an error trying to run queries like:
START TRANSACTION;
UPDATE accounts
SET money = (money + 100)
WHERE id = 1;
COMMIT;
Can you help me manage this type of query or transactions in general?

(Daniel Beckett) #2

MySQL queries fall a bit outside our area of expertise I’m afraid. Perhaps a community member will see this and be able to help but a better place to check would be a site like Stack Overflow.