【发布时间】:2023-03-11 23:26:01
【问题描述】:
这是我的模型:
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');
但是这里它显示了数组到字符串转换错误的错误.. 请帮帮我
【问题讨论】:
标签: codeigniter