Hi all,
I have a question regarding statistics.
With the help of Michael I was able to get Pax and Cargo shown seperately.
The code was :
$query=“SELECT SUM(
load) as totalpax FROMphpvms_pirepsWHEREflighttype=‘P’”;$result=DB::get_results($query);
echo $result[0]->totalpax;
Now I am trying to make something different (as usual I can’t ). In my very simple logic I get total Pax Scheduled flights with the code above, then I get total Pax Charter changing flighttype as “H”. Now the confusing part (for me) comes;
how do I sum both to get total pax carried?
Total Pax Carried = Total Pax Scheduled + Total Pax Charter
What I have done was (OK don’t laugh…kidding.. you can laugh as loud as you can )
$queryP=“SELECT SUM(
load) as totalpax FROMphpvms_pirepsWHEREflighttype=‘P’”;$resultP=DB::get_results($queryP);
$queryH=“SELECT SUM(
load) as totalpax FROMphpvms_pirepsWHEREflighttype=‘H’”;$resultH=DB::get_results($queryH);
$total=$resultH + $resultP;
echo $total[0]->totalpax;
Cheers,
Arslan