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

  <?php } echo $pay_OCTOBER;?>