<?php
$conn = mysql_pconnect('localhost', 'root', '') or die(mysql_error());
$select = mysql_select_db('database') or die(mysql_error());
$sqlgroup = "select id,sum(vote) as vote from tb_sumvote group by id order by vote desc";
$result = mysql_query($sqlgroup,$conn);
$conn = mysql_pconnect('localhost', 'root', '') or die(mysql_error());
$select = mysql_select_db('database') or die(mysql_error());
$sqlgroup = "select id,count(vote) as vote from tb_sumvote group by id order by vote desc";
$result = mysql_query($sqlgroup,$conn);
while ( $rsgroup = mysql_fetch_array($result) )
{
echo "ID : {$rsgroup['id']} = {$rsgroup['vote']}<br />";
}