Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Activerecord 编码点火器,使用活动记录自定义选择数据_Activerecord_Codeigniter - Fatal编程技术网

Activerecord 编码点火器,使用活动记录自定义选择数据

Activerecord 编码点火器,使用活动记录自定义选择数据,activerecord,codeigniter,Activerecord,Codeigniter,我想问我是否需要在我的应用程序中执行此查询 select qty, type from tItem where qty=0 and (type=1 or price=100) 如何在CodeIgniter中使用活动记录 因为如果我这样做了 $this->db->where('qty','0'); $this->db->where('type','1'); $this->db->or_where('price','100'); 查询结果如下 select q

我想问我是否需要在我的应用程序中执行此查询

select qty, type from tItem where qty=0 and (type=1 or price=100)
如何在CodeIgniter中使用活动记录

因为如果我这样做了

$this->db->where('qty','0');
$this->db->where('type','1');
$this->db->or_where('price','100');
查询结果如下

select qty, type from tItem where qty=0 and type=1 or price=100

这不是我想说的

您可以传递自定义子句,如下所示:

$this->db->where('(type = 1 OR price = 100)');