piet Posted January 14, 2008 Share Posted January 14, 2008 how would i go about getting only the future dates from this query? this is for a calendar and i would like to display only future dates including current date or today. in other words, something like "where date>today" $do=mysql_query ("SELECT id,name,date FROM calendar_events WHERE status='confirmed' ORDER by id DESC"); Quote Link to comment https://forums.phpfreaks.com/topic/85964-solved-only-future-dates-in-calendar/ Share on other sites More sharing options...
revraz Posted January 14, 2008 Share Posted January 14, 2008 Add a WHERE and add WHERE date > NOW() And date is your date field Quote Link to comment https://forums.phpfreaks.com/topic/85964-solved-only-future-dates-in-calendar/#findComment-438964 Share on other sites More sharing options...
toplay Posted January 14, 2008 Share Posted January 14, 2008 $do=mysql_query ("SELECT `id`, `name`, `date` FROM `calendar_events` WHERE `status` = 'confirmed' AND `date` >= CURDATE() ORDER by `id` DESC"); Quote Link to comment https://forums.phpfreaks.com/topic/85964-solved-only-future-dates-in-calendar/#findComment-438967 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.