I have a database of time intervals which has 2 columns (startTime, endTime) which are stored as unix timestamps in an int field type.
In my php script I have another set of intervals of unix timestamps and I only want to get a set of intervals that overlap.
I've tried the following but it doesn't seem to work.
$query = "SELECT * FROM timeslots WHERE startTime <= $endTime AND $startTime <= endTime";
This is the unterval in my database🙁1270832400, 1270836000)
This is the interval from my script: (1270832400, 1270839600)
Any ideas?