Welcome Guest, Not a member yet? Register   Sign In
Trying to figure out how to get related portfolios
#1

Hi there,

I am trying to figure out how to get related portfolios depending on the category of the one they are looking at.  I have the following that works but it has the category hard coded and I cannot for the life of me see a way of doing it.

Code:
  public function get_relatedportfolios() {
      $this->db->select('*');
      $this->db->from('cms_portfolio');
      $this->db->where('category_id', 'Retail');
      $this->db->limit(5);
      $query = $this->db->get();
      return $query->result();
  }

As you can see in my where section has 'Retail' added, I am trying to figure out how I can get information from the page to get the category_id of which ever they are bringing up so I can get the others that are around.

Thanks
Reply


Messages In This Thread
Trying to figure out how to get related portfolios - by doomie22 - 02-24-2016, 09:26 AM



Theme © iAndrew 2016 - Forum software by © MyBB