codeigniter $this->db->where(); custom string problem
Add a third parameter to the where()
and set it to FALSE
$this->db->from('posted');
$st="infor='rent' AND (typeq='in' OR typeq='out')";
$this->db->where($st, NULL, FALSE);
$q = $this->db->get();
$this->db->where()
accepts an optional third parameter. If you set it toFALSE
, CodeIgniter will not try to protect your field or table names with backticks.
CodeIgniter Documentation