here is some details for my question.
controller:
function get_info()
{
$user_id = $this->session->userdata['logged_in']['userid']
$this->load->model('message_model');
$msg_data['msg']=$this->message_model->get_user_msg($user_id);
$this->load->view('header',$msg_data);
$this->load->view('content');
$this->load->view('footer');
}
function others_goes_here()
{
$user_id = $this->session->userdata['logged_in']['userid']
$this->load->model('message_model');
$msg_data['msg']=$this->message_model->get_user_msg($user_id);
LOAD OTHER VIEWS.....
}
model:
function get_user_msg($user_id)
{
QUERY GOES HERE......
}
Now what i want to achieve is how can i make the get_user_msg to be called only once without calling it to all my other functions. Hope you guys can help me with this,
thank in advance.