このようにモデルからビューにパラメーターを渡しています
モデル
class school_model extends CI_Model{
function employee_get($student_id){
$query = $this->db->get_where('students', array('student_id'=>$student_id));
return $query->row_array();
}
}
コントローラ
function bret($student_id){
$this->load->model('school_model');
$data = $this->school_model->employee_get($student_id);
echo $data['student_gender'];
}
これは明らかにselect * from students where id=id
、例として与えられたものに変換され、次のようなブラウザを通して見られますhttp://example.com/env/at/index.php/frontpage/bret/306
get_where()
このクエリが必要な場合に適しているかどうか疑問に思っています
select student_gender,student_has_a_medical_condition from students where (student_gender = 'female' && student_has_a_medical_condition = 'no') LIMIT 40;
それが機能するために拡張する必要がありget_where()
ますか?