mysql - PHP time range validation -


i working on php page includes scheduling. planning include validation limit user input same or between time ranges other schedules under single classroom.

for better understanding,

if schedule present on database schedule 1 : mwf 9:00am - 10:00am; room 1

neither

schedule 2 : wednesday 9:00am - 10:00am; room 1 nor
schedule 3: mwf 9:30am - 10:30am; room 1 allowed entered.

can give me idea make happen?

assuming have start_time , end_time, whenever new item getting added should not find existing items such that:

start_time  between new_item_start_time , new_item_end_time or end_time between new_item_start_time , new_item_end_time 

Comments

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

Cross-Compiling Linux Kernel for Raspberry Pi - ${CCPREFIX}gcc -v does not work -

java.lang.NoClassDefFoundError When Creating New Android Project -