poe Posted May 8, 2008 Share Posted May 8, 2008 i have my dates stored in the db like in a field called fulldate: 1210118400 1210032000 1209945600 etc... how do i do a query to count number of records that are in apr, may, june etc... i have: $ttl_apr = $db->numRowsQ(" SELECT * FROM clicks WHERE date('M', fulldate) = 'April' "); $ttl_may = $db->numRowsQ(" SELECT * FROM clicks WHERE date('M', fulldate) = 'May' "); thanks Link to comment https://forums.phpfreaks.com/topic/104659-query-for-dates-in-db/ Share on other sites More sharing options...
writer Posted May 8, 2008 Share Posted May 8, 2008 I'd like to do something similar. It sounds like there's a lot to it. Link to comment https://forums.phpfreaks.com/topic/104659-query-for-dates-in-db/#findComment-535704 Share on other sites More sharing options...
fenway Posted May 8, 2008 Share Posted May 8, 2008 Are those unix_timestamps? If so, there's a FROM_UNIXTIME() function that will give you a proper SQL date, and then you can check MONTHNAME(). Link to comment https://forums.phpfreaks.com/topic/104659-query-for-dates-in-db/#findComment-535876 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.