INT 21h

Hi, I am Vladimir Smagin, SysAdmin and Kaptain. Telegram Email / GIT / RSS / GPG

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

№ 4275 В разделе Programming от 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 *

*

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

Fortune cookie: There was a young girl of Ca'lina, Had a very capricious vagina: To the shock of the fucker "Twould suddenly pucker, And whistle the chorus of "Dinah."