在代码点火器活动记录查询中的like和where


like and where in codeigniter active record query

我有一段代码,它应该返回属于特定学校的学生的详细信息,我正在粘贴代码

function return_student($query,$student_school){
    $this->db->select('student_name,student_subject,student_age,student_id');
    $this->db->from('students');
    $this->db->like('student_name',$query);
    $this->db->or_like('student_subject',$query);
    $this->db->where('student_school',$student_school);
    $query = $this->db->get();
}

现在,这段代码返回了所有数据,但没有检查该学生是否属于特定的学校,我不知道我做错了什么!!!

我拿到了,

$this->db->having('student_school',$student_school);