Calling a stored procedure from CodeIgniter's Active Record class

后端 未结 6 492
旧时难觅i
旧时难觅i 2020-12-05 17:09

In my CI application setup to query a mssql database. I want to execute a stored procedure from active record. But I

6条回答
  •  臣服心动
    2020-12-05 17:50

    I have added the following function to class CI_DB_mysqli_driver in /system/database/drivers/mysqli/mysqli_driver.php

    
        function free_db_resource()
        {
            while(mysqli_next_result($this->conn_id))
            {
                if($l_result = mysqli_store_result($this->conn_id))
                {
                    mysqli_free_result($l_result);
                }
            }
        }
    
    

    and use it after the procedure call

    $this->db->free_db_resource();

    Thanks to wework4web

提交回复
热议问题