good evening sensei. im newbie in code igniter framework. i want to ask about how to call specific data with code igniter. my code below intended to call picture's name from my database.
this my Model
function profile_picture(){
$username = $this->session->userdata('name');
$this->db->select('pict_name');
$this->db->from('picture');
$this->db->where('username="$username"');
$this->db->limit(1);
$query = $this->db->get();
return $query;
}
this is my controller
public function v_profile(){
$data['ppicture'] = $this->m_profile->profile_picture()->result();
$data['profile'] = "profile";
$this->load->view('header',$data);
$this->load->view('profile',$data);
$this->load->view('footer',$data);
}
this is my view
<img src="<?php echo base_url()."assets/img/".$ppicture; ?>" class="img-rounded" >
the codes above shows error: array to string conversion. how can i fix it? thanks