digitalgod Posted July 23, 2008 Share Posted July 23, 2008 hey guys, I'm trying to verify events that will start between curdate() and 31 days later. so far this is my query but it doesn't seem to work SELECT id, main_image FROM events WHERE member_id = '$_SESSION[members_id]' AND DATE_ADD(CURDATE() ,INTERVAL 31 DAY) >= start where start is the date and time of when the event starts. I keep getting events that have already passed with that query and I don't understand why... I just need to select all dates that start between now and 31 days later... any ideas?? Quote Link to comment Share on other sites More sharing options...
accident Posted July 23, 2008 Share Posted July 23, 2008 you forgot to add in the check for greater then today... so shoudl be SELECT id, main_image FROM events WHERE member_id = '$_SESSION[members_id]' AND DATE_ADD(CURDATE() ,INTERVAL 31 DAY) >= start AND start > CURDATE() Quote Link to comment Share on other sites More sharing options...
accident Posted July 23, 2008 Share Posted July 23, 2008 err should be start >= CURDATE() Quote Link to comment Share on other sites More sharing options...
digitalgod Posted July 23, 2008 Author Share Posted July 23, 2008 thanks accident, can't believe I didn't see that... note to self, sleep more! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.