Grouping WHERE clauses in Codeigniter

后端 未结 6 1001
陌清茗
陌清茗 2020-11-27 21:02

I want to produce the following SQL code using Active Records in Codeigniter:

WHERE name != \'Joe\' AND (age < 69 OR id > 50)

Doing t

6条回答
  •  旧时难觅i
    2020-11-27 21:37

    You can use one large string.

    $this->db->select()->from('users')->where("name != 'Joe' AND (age < 69 OR id > 50) ");

提交回复
热议问题