affordit Posted March 14, 2008 Share Posted March 14, 2008 Can someone tell me whats wrong with this line? The and portion does not seem to be working. $query = "select * from test WHERE end_date <= '". date('Y-m-d', strtotime('+ 5 days')) ."' AND remind_date = '0'"; Quote Link to comment Share on other sites More sharing options...
soycharliente Posted March 14, 2008 Share Posted March 14, 2008 Echo the query to see what it's actually trying to run. Quote Link to comment Share on other sites More sharing options...
affordit Posted March 14, 2008 Author Share Posted March 14, 2008 select * from test WHERE end_date <= '2008-03-19' AND remind_date = '0' Quote Link to comment Share on other sites More sharing options...
soycharliente Posted March 14, 2008 Share Posted March 14, 2008 That looks perfect to me. MySQL manual confirms the syntax for date comparison. I have no idea man. Try? <?php $end_date = date("Y-m-d", strtotime("+ 5 days")); $remind_date = 0; $query = "SELECT * FROM `test` WHERE `end_date` <= '$end_date' AND `remind_date` = '$remind_date'"; ?> 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.