topflight Posted April 20, 2009 Share Posted April 20, 2009 I need help with something I have a table called hours in the database and in that table I have a field called date. With that saying I want to get all the members from the database that haven't filed anything after 30 days after his/her last hour input how can I do that? Link to comment https://forums.phpfreaks.com/topic/154952-need-to-get-certain-information/ Share on other sites More sharing options...
topflight Posted April 20, 2009 Author Share Posted April 20, 2009 anything? Link to comment https://forums.phpfreaks.com/topic/154952-need-to-get-certain-information/#findComment-815088 Share on other sites More sharing options...
alphanumetrix Posted April 21, 2009 Share Posted April 21, 2009 what's the date format? unix? Link to comment https://forums.phpfreaks.com/topic/154952-need-to-get-certain-information/#findComment-815105 Share on other sites More sharing options...
topflight Posted April 21, 2009 Author Share Posted April 21, 2009 m.d.year Link to comment https://forums.phpfreaks.com/topic/154952-need-to-get-certain-information/#findComment-815173 Share on other sites More sharing options...
The Little Guy Posted April 21, 2009 Share Posted April 21, 2009 Give this a try: mysql_query("SELECT * FROM hours WHERE DATE_SUB(DATE_FORMAT(CURDATE(),'%c.%e.%Y'), INTERVAL 30 DAYS)"); Link to comment https://forums.phpfreaks.com/topic/154952-need-to-get-certain-information/#findComment-815189 Share on other sites More sharing options...
topflight Posted April 22, 2009 Author Share Posted April 22, 2009 that doesn't work I receive an error message. it seems the x for the error message is this line here: CURDATE( ) , '%c.%e.%Y' ) , INTERVAL 30 DAYS Link to comment https://forums.phpfreaks.com/topic/154952-need-to-get-certain-information/#findComment-816857 Share on other sites More sharing options...
topflight Posted April 23, 2009 Author Share Posted April 23, 2009 any other help please Link to comment https://forums.phpfreaks.com/topic/154952-need-to-get-certain-information/#findComment-817533 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.