• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
time interval clash

im doing a scheduler app and is suppose to avoid user to schedule events without interfering his other events. so i tried retrieving a set of records from the database as follows to find out whether there is any interference

                    ->where('event_end >=', $new_start_date)    // overlappin at the end
                    ->where('event_end <=', $new_end_date)
                    ->or_where('event_start <=', $new_end_date) // overlappin at the beginning
                    ->where('event_start >=', $new_start_date)
                    ->or_where('event_start <=', $new_start_date)   // overlappin in the middle
                    ->where('event_end >=', $new_end_date);

may I know what is the problem with the query? I am getting a record with event_end = 23jan and event_start = 22jan when comparing with event_start = 22feb and event_end = 23feb

i can't delete my own topic? after coming back from work I think I've found the solution already... can somebody help deleting the topic?

No deletion is forbidden. You have to live with your mistakes until the end of days Wink

Big Grin ok~
this is my first time developing using CI for a project~
hopefully everything turns out fine~

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

Users browsing this thread:
1 Guest(s)

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.