Welcome Guest, Not a member yet? Register   Sign In
When Searching for a Second Product
#3

Thanks Martin7483, but your solution would show companies with product_1 - OR -  companies with product_2.

I need it to show companies with product_1 - AND - companies with product_2.

I think I have found the solution myself ...

Code:
$this->db->join('company_products as cp1', 'cp1.comp_id = company.comp_id', 'left');
$this->db->where('cp1.sys_id', $product_1);

$this->db->join('company_products as cp2', 'cp2.comp_id = company.comp_id', 'left');
$this->db->where('cp2.sys_id', $product_2);


That seems to work ok but I haven't exhausted all tests yet.
Reply


Messages In This Thread
When Searching for a Second Product - by poldings - 06-15-2017, 04:18 AM
RE: When Searching for a Second Product - by poldings - 06-15-2017, 05:45 AM



Theme © iAndrew 2016 - Forum software by © MyBB