Welcome Guest, Not a member yet? Register   Sign In
Using activerecords where clause with occasional 'OR' match
#2

[eluser]Akinzekeel[/eluser]
First option would be the or_where() function which is used like this:

Code:
$this->db->where("status", 1);
$this->db->or_where("status", 2);

Second option: Alternatively, if your select box shows something like "all" (basically meaning do not use where) you could also do something like this:

Code:
if($this->input->post("status") != "all") {
    $this->db->where("status", $this->input->post("status"));
}


Messages In This Thread
Using activerecords where clause with occasional 'OR' match - by El Forum - 05-05-2011, 01:25 AM



Theme © iAndrew 2016 - Forum software by © MyBB