這裏是我的模型:笨:數組字符串轉換錯誤
public function count_diabetic(){
$query = $this->db->query("Select count(diabetic) as count_diabetic from member where diabetic is not NULL");
return $query->result_array();
}
public function count_hypertensive(){
$query = $this->db->query("Select count(hypertensive) as count_hypertensive from member where hypertensive is not NULL");
return $query->result();
}
這裏是我的控制器:
public function home(){
$this->load->model('Jsv_model');
$data = array(
'count_diabetic' => $this->Jsv_model->count_diabetic(),
'count_hypertensive' => $this->Jsv_model->count_hypertensive()
);
$this->session->set_userdata($data);
$this->load->view('home');
}
這是我的觀點,在PHP標籤:
echo $this->session->userdata('count_diabetic');
但是在這裏顯示的錯誤數組字符串轉換錯誤.. 請幫我
謝謝..它的工作 –
那你能接受我的回答嗎? – Ukasyah