I have a problem with the request database Active Record.
I would like to create a query:
bracket ( after WHERE and after 4) and 'Nadawca','%dor%'
SELECT * FROM (`30px__przesylki`) WHERE ( `test` = 0 AND `Status` = 4 ) AND ( `Nadawca` LIKE '%dor%' OR `Odbiorca` LIKE '%dor%' OR `NrPrzesylki` LIKE '%dor%' OR `Uwagi` LIKE '%dor%' OR `Opis` LIKE '%dor%' OR `Tracking` LIKE '%dor%' OR `Error` LIKE '%dor%' ) ORDER BY `id` asc LIMIT 10
I do in CI:
$this->db->order_by("id", "asc");
$this->db->limit($ile,$offset);
$this->db->like('Nadawca', $search);
$this->db->or_like('Odbiorca', $search);
$this->db->or_like('NrPrzesylki', $search);
$this->db->or_like('Uwagi', $search);
$this->db->or_like('Opis', $search);
$this->db->or_like('Tracking', $search);
$this->db->or_like('Error', $search);
$this->db->where('Status', 4);
$query = $this->db->get('przesylki');
receives request without brackets:
SELECT *
FROM (`30px__przesylki`)
WHERE `test` = 0
AND `Status` = 4
AND `Nadawca` LIKE '%dor%'
OR `Odbiorca` LIKE '%dor%'
OR `NrPrzesylki` LIKE '%dor%'
OR `Uwagi` LIKE '%dor%'
OR `Opis` LIKE '%dor%'
OR `Tracking` LIKE '%dor%'
OR `Error` LIKE '%dor%'
ORDER BY `id` asc
LIMIT 10
how to make the brackets?