在CodeIgniter中调用MySQL过程

execution of stored procedure in mysql i have two stored procedure first is without parameter and second is with two parameter. both are working fine in mysql as shown in image

i used the follwoing line to fetch the data in codeignitor but does not work

$sn=$this->session->userdata('running_session_id'); $sid=$row['student_id'];

$studnet_name = $this->db->query("call fetch_student()"); $row1 = $studnet_name->row_array();

$studnet_fee = $this->db->query("call fetch_student_fee_structure($sn,$sid)"); $row2 = $studnet_fee->row_array();

because these procedure have very complex query so i need to fetch data in codeignitor

douchou8935
douchou8935 从codeigniter调用存储过程的可能重复
2 年多之前 回复
dtwy2858
dtwy2858 给我们更详细的解释你的问题
2 年多之前 回复

1个回答

In your model use this code hope it will help you

public function getdata //you can change according to your requirements  
{
    return $this->db->get("table-name")->result_array();
}
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐