• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Commit and rollback with CI

Hi all!

Someone know how to use Commit and Roldback with CI?
I think that we should to use Mysqli.



Relexx, thank you very muth for your answer!

I read the CI Guide, but I have a question.

Is it possible to use CI transaction only with Mysql instead of Mysqli ?

And about auto-commit, should I set it off manually?


I believe that CI uses PDO not mysql or mysqli, assuming that you are using Database class, so my guess you would need to use mysql or mysqli transaction interface instead if you are explicity using these.

Re: Auto Commit. The whole purpose of a transaction encapsulation is the ability to roll back a number of sql statements without having to undo an already committed transaction. Auto commit is ok when not performing sql in an encapsulated transaction. I would stick with the defaults. If you want to execute multiple inserts, updates, deletes, and if one fails rollback, encapsulate the statements with trans_start trans_complete.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.