2014-12-07 65 views
1

为什么存储过程在一个事务中从未提交,当我执行的下一个功能的变化从来都反映:笨调用存储过程到交易

function insertar ($pIdEmpresa) { 

    $this->db->trans_begin(); 

    $query = $this->db->query("CALL bdAltaDetFacturasLabsXSucursalAbonos($pIdEmpresa)"); 

    if ($this->db->trans_status() === FALSE) 
    { 
     $this->db->trans_rollback(); 
    } 
    else 
    { 
     $this->db->trans_commit(); 
    } 

    return $query->result(); 
} 

回答

0

可能

$query = $this->db->query("CALL bdAltaDetFacturasLabsXSucursalAbonos(?)", $pIdEmpresa);