Welcome Guest, Not a member yet? Register   Sign In
CI transaction on functions
#1

[eluser]Raymondddd[/eluser]
Hi guys,

Currently creating a cart system for a company with CI. In the last step of the checkout i call a lot of functions like; create user, create order, order detail and more.

I need to check if any of these function went ok, and if not; use a transaction.

I've read this: http://ellislab.com/codeigniter/user-gui...tions.html but this will only work if you create a list of DB queries between the trans_start and trans_complete.

Is there something like a transaction possibility using functions?

Looking forward to your reply.

Raymond
#2

[eluser]Kamarg[/eluser]
Maybe I don't understand the problem but it sounds like you just need to check the return value(s) of your functions. If one of them failed abort the rest the process and rollback the database.




Theme © iAndrew 2016 - Forum software by © MyBB