LO deje asi y suma una cantidad que no esta en PO ni en IV
suma de PO
Código PHP:
Ver original<?php
if (isset($_GET['route'])) $route = $_GET['route']; if (isset($_GET['drug_id'])) $cid = $_GET['drug_id']; $conexion = mysqli_connect($dbhost,$dbuser,$dbpass,$dbdatabase) or
die ('error'); // Conexión $sql = "SELECT drug_id,
SUM(case route when 'po' then `count` else 0 end) totalPO,
SUM(case route when 'iv' then `count` else 0 end) totalIV,
(SUM(case route when 'po' then `count` else 0 end)) + SUM(case route when 'po' then `count` else 0 end))) AS Total
FROM core_reports_antiinfectives
";
$coma=0;
?>
<?php echo $Total = $row["Total"]; ?>