<?php 
  $resulttz8 = mysql_query("SELECT * FROM add_teachers where sr_no='$en' and session='$session' and code='$code'");
 $d_salary8=mysql_result($resulttz8,$i,"d_salary");
 echo $d_salary8;
 
?>/
<?php 
$resulta8 = mysql_query("SELECT * FROM salary where sr_no=$en and NOVEMBER='Paid' and session='$session' and code='$code' ORDER BY id ");
$qty8=0;
while ($a_rowa8 = mysql_fetch_row ($resulta8)) {
?>
<?php 
$tfee8=$a_rowa[27];
$qty8 += $tfee8;
}
echo $qty8;
$gtfee8+=$qty8;
$gfees8+=$d_salary8-$qty8;
?>