I have a simple table that allows my users to enter information about art show's they'll be attending. I give them a field for start date of the show and store it in MySql YYYYMMDD format. I have my select pull the shows that are coming up:
SELECT * FROM CALENDAR where BEGIN >= curdate() - X Limit 10;
Where X = number of days past the begin date.
I have this statement on two different sites. One client wants items to show for two weeks after they have passed and the other only wants them around for three days after.
I have found, that this select works as long as the Day of the Month is greater than X, otherwise I get ALL the records. Is there a better way to pull the records that I want to display using the select statement?
Brian
SELECT * FROM CALENDAR where BEGIN >= curdate() - X Limit 10;
Where X = number of days past the begin date.
I have this statement on two different sites. One client wants items to show for two weeks after they have passed and the other only wants them around for three days after.
I have found, that this select works as long as the Day of the Month is greater than X, otherwise I get ALL the records. Is there a better way to pull the records that I want to display using the select statement?
Brian