<?php 
  $resulttz9 = mysql_query("SELECT * FROM add_teachers where sr_no='$en' and session='$session' and code='$code'");
 $d_salary9=mysql_result($resulttz9,$i,"d_salary");
 echo $d_salary9;
 
?>/
<?php 
$resulta9 = mysql_query("SELECT * FROM salary where sr_no=$en and DECEMBER='Paid' and session='$session' and code='$code' ORDER BY id ");
$qty9=0;
while ($a_rowa9 = mysql_fetch_row ($resulta9)) {
?>
<?php 
$tfee9=$a_rowa[27];
$qty9 += $tfee9;
}
echo $qty9;
$gtfee9+=$qty9;
$gfees9+=$d_salary9-$qty9;
?>