Welcome Guest, Not a member yet? Register   Sign In
Advice using CI Database Transactions
#1

[eluser]Rey Philip Regis[/eluser]
Hi guys, I need you help again. Just want your advice cause Im having a small problem on where to put my transaction whether to put in a CONTROLLER or in a MODEL or simply create a LIBRARY then do the transaction there. Sample I have a method insertUser() in my users_model class and an insertAddress() in my address_model class. So I want to do a transaction, so id one of the insert method fails, it will rollback. What do you think about that?

Good day.
#2

[eluser]JE[/eluser]
Put your transactions(logical transactions) in a controller. Use model for processing data (database transaction).
#3

[eluser]Rey Philip Regis[/eluser]
Nako! si emilio aguinaldo pala ito....Hahaha...Thnks nga pala JE sa pag respond...Well iba yung ginawa ko, may library kasi ako na gumagamit ng mga models ko, so yung transaction nilagay ko na lang sa loob ng library. Well ok naman yung result. Ang gusto ko lang kasi is ma-standard yung coding hehe....Well thnks ulit.....Oii dami na nating pilipino dito sa CI community sana magka tulong tulong tayo.

Good day.




Theme © iAndrew 2016 - Forum software by © MyBB