scarhand Posted July 20, 2009 Share Posted July 20, 2009 This is not working: (the postdate field stores a time integer via the php time() function) $month = 'July'; $year = '2009'; $sql = mysql_query("select * from rss where date_format(postdate, '%M %Y')='$month $year' order by postdate desc"); Link to comment https://forums.phpfreaks.com/topic/166702-solved-where-date_formatpostdate-m-ymonth-year/ Share on other sites More sharing options...
PFMaBiSmAd Posted July 20, 2009 Share Posted July 20, 2009 DATE_FORMAT() operates on a DATE or DATETIME data type. Try the FROM_UNIXTIME(unix_timestamp,format) function with the second parameter set to '%M %Y' Link to comment https://forums.phpfreaks.com/topic/166702-solved-where-date_formatpostdate-m-ymonth-year/#findComment-879020 Share on other sites More sharing options...
scarhand Posted July 20, 2009 Author Share Posted July 20, 2009 Thanks. Figured it was something like that. Link to comment https://forums.phpfreaks.com/topic/166702-solved-where-date_formatpostdate-m-ymonth-year/#findComment-879036 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.