I'm trying to use Codeigniter transactions and as I am new to it, I really don't know to use $this->db->trans_begin()
or $this->db->trans_start().
What are manual transactions and when should we consider it to be used.
And once the transaction is committed, should $this->db->trans_off()
be used every time to continue auto-commit?
$this->db->trans_start()
and $this->db->trans_complete();
used together.If Any query between those two statement fail it will do rollback them automatically.If success it will commit them automatically.
$this->db->trans_begin();
any query after this line nothing will happen until you commit them or rollback them.See Examples(from CI docs)
$this->db->trans_off();
means you can disable transaction.Its up-to you whether you off it or not. I never use it, that means I always turn on transaction.see details