It is posible to do: (condition 1 AND condition2) OR (condition3 AND condition4) in codigniter?
I try:
$this->db->where(condition1 - condition2);
$this->db->or_where(condition3 - condition4);
But this is: (condition1 AND condition2) OR (condition3 OR condition4)
Just write it out in your where
$this->db->where("(condition1 AND condition2) OR (condition3 AND condition4)");
this will still escape data and you don't have to fool with the or_where method.
yes it is possible,for convenience take whatever conditions you want to used into one variable
$where ="(condition 1 AND condition2) OR (condition3 AND condition4)";
$this->db->where($where);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With