如何将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);
提前致谢。
答案 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();