<?php
include 'dbconn.php';
mysql_query("SET NAMES utf8");
$strSQL2 = "SELECT SUM( request_cost ) AS costSu FROM requests INNER JOIN devices ON requests.idDL = devices.idDL WHERE department LIKE '%$department%'";
$objQuery2 = mysql_query($strSQL2) or die("Error Query [\"$strSQL2\"]");
echo $objQuery2['costSu'];
?>
<?php
include 'dbconn.php';
mysql_query("SET NAMES utf8");
$strSQL2 = "SELECT SUM( request_cost ) AS costSu FROM requests INNER JOIN devices ON requests.idDL = devices.idDL WHERE department LIKE '%$department%'";
$objQuery2 = mysql_query($strSQL2) or die("Error Query [\"$strSQL2\"]");
$result = mysql_fetch_assoc($objQuery2);
echo $result['costSu'];
?>