2
I need to take the votes of the candidates that are in mysql and generate the percentage of votes that each one had. How can I view the result since it is inside a while?
$sql = mysql_query("SELECT * FROM candidatos ORDER BY nome_candidato");
while($ca = mysql_fetch_array($sql)){
$id_candidato = $ca['id_candidato'];
$nome_candidato = $ca['nome_candidato'];
$votos = $ca['votos'];
}
What comes inside of
$ca['votos']
? How the table is structuredcandidatos
?– Isac
$votes = one of voters who voted for the candidate
– André Monjardim
The table is pretty simple... id, nominee, and votes... that’s it.
– André Monjardim