duanlumei5941 2018-02-10 11:12
浏览 47

在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

  • 写回答

1条回答 默认 最新

  • dongyu9263 2018-02-10 12:28
    关注

    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();
    }
    
    评论

报告相同问题?

悬赏问题

  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 spring后端vue前端
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥65 汇编语言除法溢出问题