2014-10-03 68 views
0

我這段代碼應返回誰屬於特殊學校學生的詳細信息,我將代碼粘貼像和其中笨活動記錄查詢

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

我得到它,

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