Код: Выделить всё
$this->db->from('addresses');
$this->db->where('user_id', $this->session->userdata('user.id'));
$this->db->like('country', $pSearch);
$this->db->or_like('state', $pSearch);
$this->db->or_like('city', $pSearch);
$this->db->or_like('zip', $pSearch);
Код: Выделить всё
SELECT *
FROM (`addresses`)
WHERE `user_id` = '1'
AND `country` LIKE '%d%'
OR `state` LIKE '%d%'
OR `city` LIKE '%d%'
OR `zip` LIKE '%d%'
ORDER BY `country` asc
LIMIT 15
Код: Выделить всё
SELECT *
FROM (`addresses`)
WHERE `user_id` = '1'
AND (`country` LIKE '%d%'
OR `state` LIKE '%d%'
OR `city` LIKE '%d%'
OR `zip` LIKE '%d%')
ORDER BY `country` asc
LIMIT 15
Подробнее здесь: https://stackoverflow.com/questions/489 ... niter-quer
Мобильная версия