<?php 
  $resulttz7 = mysql_query("SELECT * FROM add_teachers where sr_no='$en' and session='$session' and code='$code'");
 $d_salary7=mysql_result($resulttz7,$i,"d_salary");
 echo $d_salary7;
 
?>/
<?php 
$resulta7 = mysql_query("SELECT * FROM salary where sr_no=$en and OCTOBER='Paid' and session='$session' and code='$code' ORDER BY id ");
$qty7=0;
while ($a_rowa7 = mysql_fetch_row ($resulta7)) {
?>
<?php 
$tfee7=$a_rowa[27];
$qty7 += $tfee7;
}
echo $qty7;
$gtfee7+=$qty7;
$gfees7+=$d_salary7-$qty7;
?>