I’m trying to select all the records that has the same month with the current month.
$date=date('Y-m-d');
$month=substr($date,5,2);
$res=mysql_query("SELECT DATE FROM reports");
while($row=mysql_fetch_assoc($res)){
$months=substr($row['DATE'],5,2);
}
How can I do it?
You could sql let handle that for you like this
in case you want only everything of that month this year then the query would look like this: