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
SQL statement into PHP coding
Moderator: General Moderators
Re: SQL statement into PHP coding
Pretty much any PHP + MySQL tutorial will show you how to execute a query and output the results.
Be sure to find one that uses mysqli or PDO extensions and not the mysql extension and mysql_* functions.
Be sure to find one that uses mysqli or PDO extensions and not the mysql extension and mysql_* functions.
Re: SQL statement into PHP coding
ooh, ok..
alright, i'll try to find the tutorial first..
thanx yaa..
alright, i'll try to find the tutorial first..
thanx yaa..