Monthly Select
Moderator: General Moderators
- Technocrat
- Forum Contributor
- Posts: 127
- Joined: Thu Oct 20, 2005 7:01 pm
Monthly Select
I have DB entries with a mysql date using now(). I need to select the ones that have happened this month using PHP. I am unsure of how to get the range. Does strtotime have a start month, and end month or something I can use to do this?
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Code: Select all
SELECT * FROM `table` WHERE MONTH(`field`) = '3'- Technocrat
- Forum Contributor
- Posts: 127
- Joined: Thu Oct 20, 2005 7:01 pm
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Code: Select all
SELECT * FROM `table` WHERE MONTH(FROM_UNIXTIME(`field`)) = '3'