In CodeIgniter and I'm having a hard time loading the data for it to change on the client form. The customer has to enter with his login in the part of cadastre and update his data. When he logs he goes straight into the form for it to change and has the side menus with other data to change.
The following error appears:
Severity: Notice
Message: Trying to get property of non-object
Filename: views / cadastro.php
Line Number: 225
Controller: Cadastrar.php
public function editar_cadastro($id)
{
if(null == $this->session->userdata('logado'))
{
$this->load->model('igrejas_model', 'igrejas');
$this->db->where('id', $this->session->userdata('igrejas')->id);
$data['cadastro'] = $this->igrejas->editar_cadastro($id);
$this->load->view('cadastro', $data);
}
else
{
redirect (base_url("login"));
}
}
Model: Igrejas_model.php
public function editar_cadastro($id=NULL)
{
$this->db->where('id',$id);
$query = $this->db->get("igrejas");
$return $query->result();
}