$filtre=" where post_author='$u' and day(voted)<=$a0->a and $ay1 and vote>=$a5->a and month(voted)=month(curdate()) and year(voted)=year(curdate()) GROUP BY g.id having count(*)>=$a1->a";

şeklinde çözdüm. İlgilenen herkese teşekkürler.