我正在将模型中的参数传递给这样的视图
模型
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()
它才能工作吗?