skip to Main Content

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


  1. Chosen as BEST ANSWER

    Put this Condition

    ('SELECT id FROM bookings WHERE id = "'.$caretaker_id.'" AND booking_status = "Active" AND ((booking_start_date <= "'.$start_date.'" AND booking_end_date >= "'.$start_date.'") OR (booking_start_date <= "'.$end_date.'" AND booking_end_date >= "'.$end_date.'"));');


  2. maybe you database from server vs local doesn’t have the same data, or maybe different format of dates to validate.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search