Codeigniter - 未定义的变量:id

问题描述

我不知道错误在哪里,但它总是显示未定义的变量。 这是我的代码:

型号

class profile_info extends CI_Model {

    public function get_profile_information($id)
    {
        $query = $this->db->get_where('accountSystem',array('id' => $id));
        return $query->row(); 
    }
}

控制器

class home extends CI_Controller {

    public function display_name()
    {
        $this->load->model('profile_info');
        $data['profile'] = $this->profile_info->get_profile_information($id);
        $this->load->view('account_info_view',$data);
    }
}

查看

<!DOCTYPE html>
<html>
<head>
    <title>Account Information</title>
</head>
<body>

<h1><?php echo $profile->name; ?></h1>

</body>
</html>

谢谢!

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)