MySQL WorkBench
ErrorException Array to string conversion
public function listadepontos()
{
$id = auth()->user()->id;
$somas = DB::SELECT("select SUM(pontuacao) FROM palpite WHERE id_u = '$id' ");
return view('pontuacao')->with('somas', $somas);
}
File puntuacao.php
<strong> Sua Pontuação é: <?php echo $somas;?>
</strong>
It worked like this:
@foreach($somas as $s)
<h4><strong> Sua Pontuação é: {{ $s }} </strong></h4>
@endforeach
Only once did the punctuation appear, but I do not think it's the right way to code it.