I have a function which grabs logs from database, but whenever im trying to echo this. I am only getting first item.
function getCoins($odb) {
$website = new website();
$SQLGetCoinsLog = $odb -> query("SELECT * FROM `user_logs` ORDER BY `id` DESC");
while ($getInfo = $SQLGetCoinsLog -> fetch(PDO::FETCH_ASSOC)) {
$id = $getInfo['id'];
$userid = $getInfo['userid'];
$nazwa = $getInfo['nazwa'];
$cena = $getInfo['cena'];
$transid = $getInfo['transid'];
$data = $website->converTimestamp($getInfo['data']);
$result = '
<tr class="text-center">
<td><a href="https://steamcommunity.com/profiles/'.$userid.'" target="_blank">'.$userid.'</a></td>
<td>'.$nazwa.'</td>
<td>'.$cena.'PLN</td>
<td>'.$transid.'</td>
<td>'.$data.'</td>
</tr>
';
}
return $result;
}