【发布时间】:2019-02-03 00:09:59
【问题描述】:
我在 Codeigniter 中使用 HMVC
其中有inv_module的模型,一个是普通模型
首先$this->inv_module->model在数据库中存储一些数据,与mysql事务;
那么$this->inv_module->model的事务完成前$this->common->modal的模态调用,还有一个mysql事务。
谁能告诉我,当我的第一个事务没有完成并且通用模型的事务开始时会发生什么?
我的情况是这样的-
$this->db->trans_start();
$this->db->insert('tbl_categories', $category_array);
$this->db->trans_start();
$this->CI->db->insert('tbl_macro',$macro_array);
$this->db->trans_complete();
$this->db->trans_complete();
此代码从另一个模型调用 -
$this->db->trans_start();
$this->CI->db->insert('tbl_macro',$macro_array);
$this->db->trans_complete();
请任何人帮助我
【问题讨论】:
-
有两个不同的事务。如果第二个失败,除非您这样做,否则它将对第一个没有影响。
标签: php mysql codeigniter phpmyadmin hmvc