I have a database which holds a bunch of events. Each event has a start date and an end date, so they should only show on the site when the date chosen falls between those dates.
I thought it made sense to make use of the SQL BETWEEN statement, but it does not work.
When a user chooses a year and month, I assign php vars and run the query.
Here's the query:
SELECT * FROM table WHERE $year BETWEEN YEAR(Start) AND YEAR(End) AND $month BETWEEN MONTH(Start) AND MONTH(End)
Any ideas or suggestions how to do this?
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.