table name voter
fields name - partyname,state,direction,candidatename,district,votes
date in table is like wise

```
BJP Maharashtra Nagpur-East Nitin Gadkari   Nagpur  3000    
Congress    Maharashtra Nagpur-East Lucky   Nagpur  2500    
BJP Maharashtra Nagpur-South    Rakesh  Nagpur  12000   
Congress    Maharashtra Nagpur-South    Shyam   Nagpur  15000   

```

i am selecting max votes from table on where condition of state,direction and district wise.
and display vote below.

now i want to ask you how to get above query result and display count of how much max value in my table on each direction.
plz suggest me......
i only need to display count of max value direcion wise.

for ex---
direction votes party 
east 5000 bjp
east 8000 aap
then there is only 1 max value in east direction then it display count 1..
plz tell me....

```
<table class="bordered">
    <tr> 
    <?php           
        $sqlst = "SELECT DISTINCT state FROM voter_count";
        $resultst = mysql_query($sqlst);
        while($rowst = mysql_fetch_array($resultst,MYSQL_ASSOC))
        {
        ?>  
    <td> 
<table class="bordered">
    <thead>
    <tr>             
        <th colspan="3"><?php echo $rowst['state']; ?></th>
    </tr>

     <?php  
        $state = $rowst["state"];           
        $sqlco = "SELECT DISTINCT district,direction FROM voter_count where state = '$state'";          
        $resultco = mysql_query($sqlco);
        while($rowco = mysql_fetch_array($resultco,MYSQL_ASSOC))
        {
        ?>    
     <tr>   
         <?php      
        $district = $rowco['district'];         
        $direction = $rowco['direction'];       
        $sqlvotes = "SELECT  MAX(votes) AS Vote,direction FROM voter_count where state = '$state' AND district = '$district' AND direction = '$constituency'";              
        $resultvotes = mysql_query($sqlvotes);                      
        while($rowvotes = mysql_fetch_array($resultvotes,MYSQL_ASSOC))
        {               

        ?>   
         <th><?php echo $rowvotes['Vote']; ?></th>      
          <th><?php echo $rowvotes['direction']; ?></th>         
    </tr>
    <?php }  } ?>
    </thead>
    </table>
</td>
<?php } ?>
</tr>
</table>

```