vin_akleh Posted July 3, 2011 Share Posted July 3, 2011 how can i do this? select * From table_name Where date = currentmonth when date is a double and i insert it like so date = date("U") so i want to select the month of date("U") for the current month Quote Link to comment https://forums.phpfreaks.com/topic/240998-how-to-select-current-month/ Share on other sites More sharing options...
Pikachu2000 Posted July 3, 2011 Share Posted July 3, 2011 Although I'd really recommend storing dates and times in YYYY-MM-DD HH:MM:SS format in s a DATETIME field, this should do what you're asking: SELECT field FROM table WHERE MONTH(FROM_UNIXTIME(date)) = MONTH(CURDATE()) Quote Link to comment https://forums.phpfreaks.com/topic/240998-how-to-select-current-month/#findComment-1237898 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.