Hello everyone, there is such a request (part of the request)
$this->db->where('id_category',$cID); $this->db->where('id_subcategory',$scID); $this->db->where('visible',1); if(isset($filter_brand)): if(count($filter_brand)): foreach ($filter_brand as $item): foreach ($item as $item2): $this->db->where('brand',$item2); endforeach; endforeach; endif; endif; $query = $this->db->get('tm_product_'.$city); WHAT is the same as
SELECT * FROM (`tm_product_almaty`) WHERE `price` >= '2' AND `price` <= '2111' AND `id_category` = '1' AND `id_subcategory` = '16' AND `id_category` = '1' AND `id_subcategory` = '16' AND `visible` = 1 AND `brand` = 'ЭЛИТАН' ORDER BY `title` LIMIT 12 I have a problem when I select two brands, then a request is generated for the similarity of this
AND `brand` = 'Бренд 1' AND `brand` = 'Бренд 2' And I need to have a request like this
SELECT * FROM (`tm_product_almaty`) WHERE `price` >= '2' AND `price` <= '2111' AND `id_category` = '1' AND `id_subcategory` = '16' AND `id_category` = '1' AND `id_subcategory` = '16' AND `visible` = 1 AND (`brand` = 'Брэнд 1' or `brand` = 'Брэнд 2') ORDER BY `title` LIMIT 12 How to implement it