如何将此mysqli_fetch_array代码转换为codeigniter

时间:2018-05-30 04:13:26

标签: php codeigniter

如何将php中的mysqli_fetch_array转换为codeigniter?

$kueri7 = "SELECT ceil(count(kelas_id)/(select count(user_id) from tuser where matpel_id = $idmatpel)) as jumlah from tkelas";
$cocok8 = mysqli_query($con, $kueri7);
$cocok_kelas_maksimal = mysqli_fetch_array($cocok8);

提前致谢。

1 个答案:

答案 0 :(得分:0)

使用codeIgniter,您的代码将如下所示:

$query = $this->db->query("SELECT ceil(count(kelas_id)/(select count(user_id) from tuser where matpel_id = $idmatpel)) as jumlah from tkelas", FALSE);
$cocok_kelas_maksimal = $query->result_array();