此问题在此处已有答案:
CodeIgniter get_where(4个答案)
上个月关门了。
我需要进行查询以仅返回活动记录,在本例中为imo_status
== 1
进行此查询的最佳方式是什么?我使用CI3
下面是源代码。
// LISTA OS AGENCIAMENTOS NO BANCO DE DADOS
public function getProperties()
{
$this->db->select('*');
$this->db->from('ci_properties');
$this->db->where('imo_status' == 1);
return $this->db->get("ci_properties")->result_array();
/*$query = $this->db->get("ci_properties");
return $query->result_array();*/
}
2条答案
按热度按时间pwuypxnk1#
您建立查询,然后不使用它:
这将清除查询构建器,基本上从'ci_properties'执行'get all'。要使用您的查询:
这是因为你已经在'from'部分指定了表,get('table name'),将得到所有。
yyhrrdl82#
我解决了这个