';
echo '
';
echo '';
}
else
{
$str_requete = 'SELECT SUM(votant) as cntvotant FROM `tblvote`';
$result_vote = mysql_query ($str_requete,$news_db) or
die('Erreur de requête: ' . mysql_error());
$total_votants = 0;
if ($nb_votants = mysql_fetch_object($result_vote))
$total_votants = intval($nb_votants->cntvotant);
$str_requete = 'SELECT libelle,votant FROM `tblvote` ORDER BY id';
$result_vote = mysql_query ($str_requete,$news_db) or
die('Erreur de requête: ' . mysql_error());
$vote = mysql_fetch_object($result_vote);
echo '
';
echo '';
while ($vote = mysql_fetch_object($result_vote))
{
$pcent_vote = round((intval($vote->votant) / $total_votants) * 100);
$pcent_vote_txt = strval($pcent_vote);
echo ' | ';
echo ' |
';
}
echo '
';
}
?>