Hi.. i'm new in PHP.. i really need to learn more in PHP..

but then, i have a task that i must do..but i don't know how to do..
can anybody help me about it..really really need help..thank you very much!

this is the SQL statement..i don't know how to do in PHP coding, to make the result appear..

select value2,value3,
case when (tatr_status='SL' or tatr_status='C') then (count(if(date(tatr_lengkapdate)>=date(tatr_lulus_date)-interval 1 month,tatr_lengkapdate,NULL))) else (count(if(date(tatr_lengkapdate)>=curdate()-interval 1 month,tatr_lengkapdate,NULL))) end as b1,
case when (tatr_status='SL' or tatr_status='C') then (count(if(date(tatr_lengkapdate)>=date(tatr_lulus_date)-interval 2 month and date(tatr_applydate)<date(tatr_lulus_date)-interval 1 month,tatr_lengkapdate,NULL))) else (count(if(date(tatr_lengkapdate)>=curdate()-interval 2 month and date(tatr_lengkapdate)<curdate()-interval 1 month,tatr_lengkapdate,NULL))) end as b2,
case when (tatr_status='SL' or tatr_status='C') then (count(if(date(tatr_lengkapdate)>=date(tatr_lulus_date)-interval 3 month and date(tatr_applydate)<date(tatr_lulus_date)-interval 2 month,tatr_lengkapdate,NULL))) else (count(if(date(tatr_lengkapdate)>=curdate()-interval 3 month and date(tatr_lengkapdate)<curdate()-interval 2 month,tatr_lengkapdate,NULL))) end as b3,
case when (tatr_status='SL' or tatr_status='C') then (count(if(date(tatr_lengkapdate)>=date(tatr_lulus_date)-interval 4 month and date(tatr_applydate)<date(tatr_lulus_date)-interval 3 month,tatr_lengkapdate,NULL))) else (count(if(date(tatr_lengkapdate)>=curdate()-interval 4 month and date(tatr_lengkapdate)<curdate()-interval 3 month,tatr_lengkapdate,NULL))) end as b4,
case when (tatr_status='SL' or tatr_status='C') then (count(if(date(tatr_lengkapdate)<date(tatr_lulus_date)-interval 4 month,tatr_lengkapdate,NULL)))else (count(if(date(tatr_lengkapdate)<curdate()-interval 4 month,tatr_lengkapdate,NULL))) end as more,
count(*) as total
from ta_transaction,ta_fieldconvert where tatr_status=value1 and flags='status' and tatr_lengkapdate>=$P{dari} and tatr_lengkapdate<=$P{hingga} and tatr_status<>'I'
group by value2, value3 order by value3