luminous Posted April 29, 2010 Share Posted April 29, 2010 I've got a table with some values in and a datetime field (fieldname: time). I want to be able to select the values from the current time (NOW()) until a week into the future. I've tried: SELECT * FROM dd_restriction WHERE (time(NOW(), INTERVAL 7 DAY)) But it's not working :'( what am I doing wrong? Quote Link to comment https://forums.phpfreaks.com/topic/200156-selecting-values-from-a-week-of-current-date/ Share on other sites More sharing options...
jdavidbakr Posted April 29, 2010 Share Posted April 29, 2010 Your "where" clause isn't doing any comparison. You need something like SELECT * FROM table WHERE date >= now() and date <= date_add(now(), interval 7 day) Quote Link to comment https://forums.phpfreaks.com/topic/200156-selecting-values-from-a-week-of-current-date/#findComment-1050611 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.