我的这段代码应该返回属于特定学校的学生详细信息,我会粘贴代码
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();
}
现在这段代码正在返回所有数据但不检查该学生是否属于该特定学校,我不知道我做错了什么!!!
答案 0 :(得分:0)
我明白了,
$this->db->having('student_school',$student_school);