0
In the Codeigniter and I’m having a hard time loading into the customer’s form the data for him to change. The customer has to log in to the registration part and update their data. When it logs directly into the form for it to change and has the side menus with other data to change.
Appears the following error:
Severity: Notice
Message: Trying to get Property of non-object
Filename: views/cadastre.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();
}
Put the file code
views/cadastro.php
and point to the line 225 where the error is. Anotice
is saying that there is a reference to a non-existent object on the page. You have to find out if the object exists and is being passed correctly.– Ricardo Moraleida
how you store the session
$this->session->userdata('igrejas')
that is to sayigrejas
? put that in your question, they’re saying there’s no such thing->id
may be up to a['id']
, so that item is missing!– novic