【问题标题】:To call MySQL procedure in CodeIgniter在 CodeIgniter 中调用 MySQL 过程
【发布时间】:2018-07-21 01:36:29
【问题描述】:

execution of stored procedure in mysql 我有两个存储过程,第一个是没有参数的,第二个是有两个参数的。如图所示,两者都在 mysql 中正常工作

我使用以下行在 codeignitor 中获取数据但不起作用

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

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

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

因为这些过程有非常复杂的查询,所以我需要在 codeignitor 中获取数据

【问题讨论】:

标签: php mysql codeigniter


【解决方案1】:

在您的模型中使用此代码希望它对您有所帮助

public function getdata //you can change according to your requirements  
{
    return $this->db->get("table-name")->result_array();
}

【讨论】:

    【解决方案2】:

    我google了很多,最后通过在codeignitor中调用存储过程后添加以下代码找到了上述问题的解决方案。

    mysqli_next_result($this->db->conn_id);

    【讨论】:

      猜你喜欢
      • 2011-12-07
      • 2016-01-17
      • 2023-04-08
      • 2013-08-14
      • 1970-01-01
      • 2015-11-11
      • 2018-03-07
      • 2011-09-13
      • 1970-01-01
      相关资源
      最近更新 更多