Between Condition is not working on server side
$this->db->group_start();
$this->db->where(‘("’.$start_date.’" BETWEEN start_date AND end_date)’, NULL, FALSE);
$this->db->or_where(‘("’.$end_date.’" BETWEEN start_date AND end_date)’, NULL, FALSE);
$this->db->group_end();
This Between Condition is working on local but not on server side
2
Answers
Put this Condition
('SELECT
id
FROMbookings
WHEREid
= "'.$caretaker_id.'" ANDbooking_status
= "Active" AND ((booking_start_date
<= "'.$start_date.'" ANDbooking_end_date
>= "'.$start_date.'") OR (booking_start_date
<= "'.$end_date.'" ANDbooking_end_date
>= "'.$end_date.'"));');maybe you database from server vs local doesn’t have the same data, or maybe different format of dates to validate.