I want to implement 'start transaction and rollback' on 2 queries that update a table in a stored procedure. I want the second query to only execute if the first query was successful. I really don't know how to do this. I can't seem to understand MySQL documentation. Here are my queries:
BEGIN
UPDATE table SET status = 1 WHERE user_id = 1
UPDATE table SET status = 2 WHERE user_id = 2
END;