INT 21h

Hi, I am Vladimir Smagin, sysadmin. Telegram Email GPG

CodeIgniter 2: take “like” in brackets (easy patch)

№ 4275 В разделе "Программирование" от May 11th, 2012,

Sometimes you need to make porno like this:

SELECT blablabla
FROM (`blablabla`)
WHERE `blabla` = bla
AND `blabla` = 100500
AND  ( `blabla`  LIKE '%14%'
OR  `blablabla`  LIKE '%14%'  )  

CodeIgniter can’t add brackets out of box, but I created patch that help you to solve this problem. Download this file DB_active_rec.php.patch and patch you /system/database/DB_active_rec.php.
Now you can use it:

 $this->db->or_like('( dogovor_num',$str);
 $this->db->or_like("podkluchenie.kvartira",$str,'both'," ) ");

Нет комментариев »

Leave a Reply

Your email address will not be published. Required fields are marked *

*

Яндекс.Метрика