-3
First, I’m not good at writing, but I’ll try to explain the problem
I need to print only one cell (amount of votes already taken) of the query result table, but I am unable to access the value of the conversion error.
i was having to make the query and echo straight into the function call in html
The votes need this after the name description
function pegarQtdVotos($conexao,$classificacao){
$query = "select qtd_votos from VOTOS where id={$classificacao}";
$resultado = mysqli_query($conexao, $query);
$qtd = mysqli_fetch_assoc($resultado);
return $qtd;
}
<p class="alert-success"><input type="radio" name="classificacao" id="classificacao" value="1"> Execelente</p>
<p class="alert-info"><input type="radio" name="classificacao" id="classificacao" value="2"> Bom </p>
<p class="alert-warning"><input type="radio" name="classificacao" id="classificacao" value="3"> Regular </p>
<p class="alert-danger"><input type="radio" name="classificacao" id="classificacao" value="4"> Ruim </p>
$query = "select qtd_votes from VOTES Where id={$classification}"; $result = mysqli_query($connection, $query); while ($Rows = mysqli_fetch_assoc($result)) { echo $Rows['qtd_votes'];};
– user60252
It worked, thanks... I wanted to do this while on the other page, but when I already print inside the function it worked... thanks... @Leocaracciolo puts the code in the answer to the question
– Marcos Sarges