The ability to group SQL statements into groups that can be committed or rolled back en masse is only available in the InnoDB table handler in MySQL - MyISAM does not support transactions, and will silently ignore any transaction-control statements. To get started with a transaction, send the "BEGIN" SQL statement through mysql_query(), followed by as many statements as you want, then either "COMMIT" or "ROLLBACK" to save or abort your changes.

Changed made inside transactions are, by default, visible only to yourself - once you use COMMIT, the changes are made permanent, and everyone can see them. Once you use COMMIT or ROLLBACK, you need to use another BEGIN to start a new transaction.


Next chapter: MySQL Improved >>

Previous chapter: Choosing a table type

Jump to:


Home: Table of Contents

Follow us on or Twitter

Username:   Password:
Create Account | About TuxRadar