|  | 
 
| 大家好,请问一下CI的事务如何实现,听说需要使用type=innodb,能不能针对我的代码来说明一下啊?O(∩_∩)O谢谢 代码:
 ......
 $this->db->trans_begin();
 //[李毅]的银行账户总共就就是1000元
 $this->db->query("update tb_bankaccount set money = money - 500000 where userName = '李毅'");
 //转账给[张敏]
 $this->db->query("update tb_bankaccount set money = money + 500000 where userName = '张敏'");
 
 if ($this->db->trans_status() === FALSE)
 {
 $this->db->trans_rollback();
 return log_message();
 }
 else
 {
 $this->db->trans_commit();
 return 'seccess';
 }
 ....
 | 
 |