I am creating a function to obtain interpreter data based on the interpreter ID. This is the function that I created:
interprete_model.php
Models
public function interpreteID($id)
{
//consultar los datos
$this->db->select('*');
$this->db->where('id_interprete', $id);
$this->db->from('tbl_interpretes');
$query = $this->db->get();
if($query->num_rows() > 0 )
{
return $query->result();
}
else
{
return false;
}
}
I'm calling this method in my interpreter / profile.php file:
Controller
public function index()
{
$id = $this->session->userdata('user_id');
echo "User ID ".$id;
$query = $this->interprete_model->interpreteID($this->session->userdata('user_id'));
echo "consultar los datos: ".$query;
//vista
$this->load->view('perfil_view',$data);
}
When I do this I get an error saying:
missing the data on the web.
Could someone please tell me why he is doing this?