mysql : Recieve data only per months
- by Tristan
Hello,
few times ago, i asked how to do to display datas per month, i must told a bad explanation because i just figured out that it's not what i want :
Here's what I got :
$req1 = ...
AND v.date > (DATE_SUB(CURDATE(), INTERVAL 2 MONTH))
AND v.date < (DATE_SUB(CURDATE(), INTERVAL 1 MONTH))
$req2= ...
AND v.date > (DATE_SUB(CURDATE(), INTERVAL 3 MONTH))
AND v.date < (DATE_SUB(CURDATE(), INTERVAL 2 MONTH))
But the problem, imagine that today you are the 10th june, it's going to calculate ALL the data between the
10 june to the 10 may
then the 10 may until the 10 april...
But what i want is data :
from 1st may to 1 st june,
from 1st june to 1st july...
do you see what i mean ?
thank you ;)