Combining `where` and `like` statements by using the CI activerecords

前端 未结 6 2287
一个人的身影
一个人的身影 2021-01-06 18:48

To cut a long story short: Is it possible and if it is - how can I build a query that looks somewhat like this one

SELECT * FROM a
    WHERE row = 1 AND 
            


        
6条回答
  •  甜味超标
    2021-01-06 19:11

    You can use the following:

    $this->db->like('title', 'match', 'before');
    

    It will produce:

    WHERE `title` LIKE '%match' ESCAPE '!'
    

提交回复
热议问题