<?php 
  $resulttz10 = mysql_query("SELECT * FROM add_teachers where sr_no='$en' and session='$session' and code='$code'");
 $d_salary10=mysql_result($resulttz10,$i,"d_salary");
 echo $d_salary10;
 
?>/
<?php 
$resulta10 = mysql_query("SELECT * FROM salary where sr_no=$en and JANUARY='Paid' and session='$session' and code='$code' ORDER BY id ");
$qty10=0;
while ($a_rowa10 = mysql_fetch_row ($resulta10)) {
?>
<?php 
$tfee10=$a_rowa[27];
$qty10 += $tfee10;
}
echo $qty10;
$gtfee10+=$qty10;
$gfees10+=$d_salary10-$qty10;
?>