How to write multiple queries using MySQL Transaction

| Last Updated: | In: Mysql, Oracle


A transaction is a sequential group of database manipulation operations, which is performed as if it were one single work unit.

These statements provide control over use of transactions:

  • START TRANSACTION or
    BEGIN start a new transaction.

  • COMMIT commits the current transaction,
    making its changes permanent.

  • ROLLBACK rolls back the current
    transaction, canceling its changes.

  • SET autocommit disables or enables the
    default autocommit mode for the current session.

mysql_transaction

MySQL transaction example


About: Prem Tiwari

Prem Tiwari is the founder of freewebmentor.com and is a professional developer who has vast experience in PHP and open source technologies. Apart from this, he is a blogger by hobby.


You may also like: