I have a database to manage my schedule the database looks like:
CREATE TABLE activities(
name VARCHAR(255),
startTime INT(11),
endTime INT(11)
);
Now I'd like to detect overlaps in activities. so lets say i have the following variables:
$start=time();
$end=time()+3600;
now i want to query the database to get ALL activities that overlap with these times. Anyone has an idea how to do this?
Thank you!
p.s. I realize similiar questions have already been asked but i couldn't find the answer for MySQL with a table similiar to this one.