I wish to rewrite a mysql query which use month() and year() functions to display all the posts from a certain month which goes to my function as a \'Y-m-d\' parameter forma
You might want to look at the strtotime and date functions.