Sorry, If I sound so dumb on this but recently started php and Codeigniter.
On my product page I am able to print product's details except users details.
I get 'product id' reference from URL and then try to take reference from 'product id' for 'username' associated with it.
Here is the controller:
public function index() {
$id = $this->uri->segment(3);
//fetching item details on item page by this item id
$data['listings'] = $this->my_listings_model->all_listings_details($id);
//fetching username of user on item page by this item id
$username = $this->my_listings_model->get_user_name($id);
//fetching user details on item page by this username
$data['user_info'] = $this->my_profile_model->get_all_details($username);
$this->load->view('item', $data);
}
And Model:
// Fetch Product details with the help of item id.
function all_listings_details($id){
$this->db->select('*');
$this->db->from('vbc_vacation_item_attri');
$this->db->where('vbc_item_id', $id);
$query = $this->db->get();
$query_result = $query->result();
return $query_result;
}
// Function to select username with the help of item id.
function get_user_name($id){
$this->db->select('v_posting_member');
$this->db->from('vbc_vacation_item_attri');
$this->db->where('vbc_item_id', $id);
$query = $this->db->get();
$query_result = $query->result();
return $query_result;
}
// Collect *All Details* Of A User..
function get_all_details($username){
$this->db->select('*');
$this->db->from('vbc_registered_members');
$this->db->where('v_member_username', $username);
$query = $this->db->get();
$result = $query->result();
return $result;
}
I have spent some good time trying to fix it but no good.
Shows error:
Message: Array to string conversion