I’m using the latest version of codeigniter and am trying to write a simple query using the activerecord class, but can’t quite figure out how to do an OR statement. Here’s the code:
function get_active_trades()
{
$query = $this->db->get_where('trades', array('trade_status !=' => 2));
return $query->result();
}
Ideally, it should be if trade_status != 2 or user_trade_status != 2. However, I can’t seem to find a way to make this happen. I’ve found the following on the help page, but can’t seem to get it to work either:
$this->db->or_where();
Any suggestions on how this should be done with activerecord?
Like this: