Calling stored procedure in codeigniter

前端 未结 4 681
执笔经年
执笔经年 2020-12-14 12:37

I am using latest codeigniter and trying to call stored procedure from my model. Also I am using mysqli as database driver. Now I am having an error when I call two stored p

4条回答
  •  盖世英雄少女心
    2020-12-14 13:30

    change dbdriver to "mysqli" put this function to your model and use it to call stored procedure

    function call( $procedure )
    {
        $result = @$this->db->conn_id->query( $procedure );
    
        while ( $this->db->conn_id->next_result() )
        {
            //free each result.
            $not_used_result = $this->db->conn_id->use_result();
    
            if ( $not_used_result instanceof mysqli_result )
            {
                $not_used_result->free();
            }
        }
    
        return $result;
    
    }
    

提交回复
热议问题