1
Good, I’m trying to print values on a select page I did on a model. But it gives me the error: Undefined variable: login. Controller:
function perfil()
{
$this->load->model('perfil_model');
$data['list'] = $this->perfil_model->getAllDisplayable3();
$data['username'] = $this->session->userdata('username');
$this->load->view('perfil_view',$data);
}
Model: perfil_model
function getAllDisplayable3()
{
$this->db->select('id_login, nome, username, password, cod_postal, telefone, email, localidade, rua');
$result = $this->db->get('login');
return $result->result();
}
View: profile_view
<input class="form-control" id="nome" value="<?php echo $login->nome?>" type="text">
What is wrong or missing? Thank you.