我尝试使用此代码,但调用的存储过程仍在数据库中运行,但在代码中它已经完成。
$this->db->trans_start();
$this->db->query('CALL sp_process();');
if ($this->db->trans_status() === FALSE) {# Something went wrong.
$this->response->message[] = array(
'message' => "Encountered a problem",
'type' => 'error'
);
}
else {
$this->db->trans_commit();
$this->response->message[] = array(
'message' => 'successfully processed',
'type' => 'success'
);
}
$this->db->trans_complete();
1条答案
按热度按时间vd2z7a6w1#
从手工运行事务的单据中:
一定要使用
$this->db->trans_begin()
在运行手动事务时,不是$this->db->trans_start()
.所以试着用
$this->db->trans_begin();