<?php
$result = mysql_query("SELECT * FROM salary where sr_no=$en and MAY='Paid' and session='$session' and code='$code' ORDER BY id ");
while ( $a_row = mysql_fetch_array( $result ) )
 {
 $pay_MAY+=$a_row['total'];
 ?>

  <?php } echo $pay_MAY;?>