0
多個參數搜索我想用兩個參數patient_id和電子郵件在笨
控制器
型號搜索
function search_patients($search)
{
return $query = $this->db->get_where('patient', array('patient_id'=> $search))->result();
}
多個參數搜索我想用兩個參數patient_id和電子郵件在笨
控制器
型號搜索
function search_patients($search)
{
return $query = $this->db->get_where('patient', array('patient_id'=> $search))->result();
}
你應該綁定你那裏像這樣
$where = '(patient_id ="' . $search . '" or email = "' . $search . '")';
$this->db->select('*');
$this->db->from('patient');
$this->db->where($where);
$query = $this->db->get();
$result = $query->result_array(); // this will return you array
return $result;
你是偉大的! !非常感謝你....願上帝保佑你 –
很高興幫助:) –
要使用AND or OR –
不明確的信息。請詳細說明。 –
OR 解釋:任何一個 –