->where('orders.date_paid', 'BETWEEN', array($from, $to))
->and_where('orders.status', '=', 'new')
->or_where('orders.status', '=', 'delivered')
I would like to show all rows where date_paid is between $from and $to, where status is either new or delivered.
When i add this or_where(), it ignores the BETWEEN $from and $to date_paid where clause.
How can i do this right?
You need to group your conditions.