$listSql=mysql_query("SELECT em.rank,(select no_of_post from no_of_post where rank_id=em.rank limit 1) as Total_Post,count(np.personal_number) as Available,(select rank_hin from rank_master where rank_id=em.rank limit 1) as rank_name FROM `new_posting_detail` as np inner join employee_master as em on np.personal_number=em.personal_number where (np.joining_unit!='' and np.joining_unit!=0 and np.joining_sub_unit!='' and np.joining_sub_unit!=0) and em.rank!=0 and em.rank!='' and em.rank in (select rank_id from no_of_post) group by em.rank");
$i=1;
while($row=mysql_fetch_array($listSql)){
?>