Invalid argument supplied for foreach() in Codeigniter

前端 未结 3 1285
[愿得一人]
[愿得一人] 2021-01-07 07:41

I am getting error message: Invalid argument for foreach() in my View. I wanted to display all entries in my mysql table but i kept on getting error message. I am a newbie i

3条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-07 08:24

    I think this code modular:

    public function getAll() {
        $this->db->select('bcode, bname, btel, badd');
        $this->db->from('branches');
    
        $query = $this->db->get('branches');
    
        return $this->db->query($query)->result_array();
    }
    

提交回复
热议问题