Database structure:
activities: id, description, date, time, endDate, endTime, userId
So we got an activity, it is required to have a date, the time, endDate and endTime are not required.
The problem is, if I want to get all activities of today I got:
SELECT A.*, U.*
FROM activities
JOIN users U
ON U.id = A.userId
WHERE DATE(A.date) = DATE(CURDATE())
So that will indead, get all the activities of today, but what if we got an activity that started yesterday, and the end date will be tomorrow, I still have to get the activity?
We want all the activities that will happen next weekend so than we got this query:
SELECT A.*, U.*
FROM activities
JOIN users U
ON U.id = A.userId
WHERE UNIX_TIMESTAMP(A.DATE) BETWEEN strtotime('previous saturday')
AND (strtotime('previous monday') - 1)
But once again, what if the 'date' is on friday and will end on tuesday, and I get all the activities that are happening in the weekend, I still have to get that activity, how do I solve this?
Thanks alot for help already! :)