bsamson Posted May 13, 2008 Share Posted May 13, 2008 Alright I currently have this code: <?php mysql_query("SELECT * FROM v2callbacks WHERE DATE_FORMAT(FROM_UNIXTIME(`entrydate`), '%Y/%m/%d') = '2008/05/13'") ?> How do I change this section: DATE_FORMAT(FROM_UNIXTIME(`entrydate`), '%Y/%m/%d') to add 15 days to the entrydate field? Not change the field BUT take the entrydate and add 15 days. Thanks in advance! Quote Link to comment Share on other sites More sharing options...
bsamson Posted May 13, 2008 Author Share Posted May 13, 2008 hmmm ... when I run the following query ... it doesn't appear to error out. Any pros and/or cons? <?php mysql_query("SELECT * from v2callbacks WHERE DATE_ADD(DATE_FORMAT(FROM_UNIXTIME(`entrydate`), '%Y/%m/%d'), INTERVAL 15 DAY) = '2008/05/13'"); ?> Thanks again... Quote Link to comment Share on other sites More sharing options...
BlueSkyIS Posted May 13, 2008 Share Posted May 13, 2008 looks good at first glance. but you might not see errors unless you mysql_query() or die(mysql_error()); Quote Link to comment Share on other sites More sharing options...
bsamson Posted May 13, 2008 Author Share Posted May 13, 2008 Thanks for the input. But it doesn't appear to be working. Via phpMyAdmin I am running this query: SELECT * from v2callbacks WHERE DATE_ADD(DATE_FORMAT(FROM_UNIXTIME(`entrydate`), '%m/%d/%Y'), INTERVAL 15 DAY) = '05/28/2008' I have a field that I set the entrydate to: 1211995559 (which is 05/28/2008) However, phpMyAdmin reports: MySQL returned an empty result set (i.e. zero rows). (Query took 0.0004 sec) Any suggestions? Quote Link to comment Share on other sites More sharing options...
bsamson Posted May 13, 2008 Author Share Posted May 13, 2008 *bump* No suggestions? I have googled and search and cannot figure this one out... Quote Link to comment Share on other sites More sharing options...
Barand Posted May 13, 2008 Share Posted May 13, 2008 Thanks for the input. But it doesn't appear to be working. Via phpMyAdmin I am running this query: SELECT * from v2callbacks WHERE DATE_ADD(DATE_FORMAT(FROM_UNIXTIME(`entrydate`), '%m/%d/%Y'), INTERVAL 15 DAY) = '05/28/2008' I have a field that I set the entrydate to: 1211995559 (which is 05/28/2008) However, phpMyAdmin reports: MySQL returned an empty result set (i.e. zero rows). (Query took 0.0004 sec) Any suggestions? If you are adding 15 days, the entrydate would need to be 5/13/2008 to get a match on 5/28/2008 Quote Link to comment Share on other sites More sharing options...
Barand Posted May 13, 2008 Share Posted May 13, 2008 If you are looking for recs with an entrydate 15 days from now SELECT * from v2callbacks WHERE DATE(FROM_UNIXTIME(`entrydate`)) = CURDATE() + INTERVAL 15 DAY Quote Link to comment Share on other sites More sharing options...
bsamson Posted May 13, 2008 Author Share Posted May 13, 2008 AWESOME!!!!! THANK YOU SO MUCH!!!!!! 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.