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

前端 未结 6 2254
一个人的身影
一个人的身影 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:19

    Why dont you try this:

        $this->db->where("row = 1 AND 
            (other_row LIKE '%..%' OR another_row LIKE '%..%')");
    $this->db->get('a');
    

    It's how you can write custom WHERE in CI. If it is not what u r looking for, feel free to explain

提交回复
热议问题