Sir I have these 2 tables (Arrival+Pouring) shown in Attachment
I create result table with this query
select c1.date,sum(nvl(cx.purchase-cx.sold,0)) as opening,c1.purchase,c1.sold,;
sum(nvl(cx.purchase-cx.sold,0)) + c1.purchase-c1.sold as closing ;
from ;
(select NVL(a.date,b.date) as date,CAST(NVL(a.qty,0) as integer) as purchase,;
CAST(NVL(b.qty,0) as integer) as sold from purchase a FULL JOIN sold b ON a.date = b.date order by 1) c1 ;
left join;
(select NVL(a.date,b.date) as date,CAST(NVL(a.qty,0) as integer) as purchase,;
CAST(NVL(b.qty,0) as integer) as sold from purchase a FULL JOIN sold b ON a.date = b.date order by 1) cx ;
on c1.date>cx.date;
group by c1.date,c1.purchase,c1.sold
The query work fine to get opening and closing balance.
But I want to use PHP Codes like array and echo etc to show result.
Please help me to convert the query into php codes.
Thanks