Hello. Good night.
I have a question
I want to sum all the values of the field valor_reais
of my table
forexample
id
1=150id
2=100id
3=100
Iwanttheobviousresult,350
I'vetriedsomethinglike:
$buscar=$pdo->prepare("SELECT * FROM tabela");
$buscar->execute();
$valor = $buscar->fetch(PDO::FETCH_OBJ);
$quantidade = $buscar->rowCount();
$valor_final = $valor->valor_reais;
echo $quantidade * $valor_final;
but is returning 450