Codeigniter Transaction Example

This tutorial will show you how we can use transaction in Codeigniter. We know that transaction is an important part of persistence storage media because we may save, update or delete data from persistence storage area. For example, in database we may need to update multiple tables or we may require to delete from multiple tables, hence we may face some inconsistency during database tables updation or deletion from database tables. During updation few tables may be updated and few tables may not be updated. Similarly, in case of deletion few tables may get deleted and few may not. So data will be in inconsistent state. Therefore, we want either a unit of work will be carried out completely or none. Hence the transaction is required to make it happen.
For information on Codeigniter transaction please go through


Knowledge of PHP & Codeigniter
MySQL 5.x
Apache HTTP server 2.2
Codeigniter 2.1.4

Now look at the steps how transaction works in Codeigniter

Step 1. Create MySQL tables and these tables will be used for updation or deletion of data.

Step 2. Create usermodel.php file for updating to or deleting data from database

That’s all. Thanks for reading.


Software Professional, I am passionate to work on web/enterprise application. For more information please go to about me. You can follow on Twitter. You can be a friend on Facebook or Google Plus or Linkedin

2 thoughts on “Codeigniter Transaction Example

  1. Hello Soumitra,
    Thanks for all your examples

    Is there any continuation for the above tutorial..? if yes please help us in CI itself.

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.