concept transaction in category php

This is an excerpt from Manning's book PHP in Action: Objects, Design, Agility.
In this section, we’ll first find out how to test transactions. Then we’ll add the actual Mysql transactional behavior to our code. Based on our experience from the example, we’ll discuss whether testing really removes the need for debugging, and what else we need to do to ensure that we’ve done all we can to produce code of high quality.
In order to get real transactional behavior, we need to open the transaction and commit it. We want to open it implicitly when the MysqlTransaction object is created, and commit it only when commit() is called explicitly. We start by opening a transaction in the constructor:
class MysqlTransaction { function __construct($host, $user, $password, $db) { $this->connection = mysql_connect( $host, $user, $password, $db, true); mysql_select_db($db, $this->connection); $this->throwOnMysqlError(); $this->begin(); } //... }Opening the transaction is fairly technical. Here is the version for MySQL: