quando si vede documentation È possibile utilizzare $this->db->where()
con terzo parametro impostato su FALSE per non uscire dalla query. Esempio:
$this->db->where('field is NOT NULL', NULL, FALSE);
Oppure è possibile utilizzare query string personalizzato come questo
$where = "field is NOT NULL";
$this->db->where($where);
Così il vostro generatore di query sarà simile a questa:
$this->db->select('*');
$this->db->where('field is NOT NULL', NULL, FALSE);
$this->db->get('donors');
O
$this->db->select('*');
$where = "field is NOT NULL";
$this->db->where($where);
$this->db->get('donors');
fonte
2015-10-15 09:57:53
Possibile duplicato di [clausola CodeInizio Where] (http://stackoverflow.com/questions/10109047/codeigniter-where-clause) – vhu