I am creating a calendar application. In the Events table, there are two columns, a start and end timestamp.
EVENTS - { start_timestamp, end_timestamp }
I have two variables in my PHP application. One is the timestamp of the beginning of a month, another is the timestamp of the end of a month.
I want to select from the events table if that event is inside the month. Somehow I need to test for intersection between the ranges of the start and end timestamps of each event, and the beginning and end of the month. Is this possible? Are there any better methods to accomplish this?