<?php

$pdo    = $db->getPdo();
$stmt   = $pdo->prepare("SELECT thumb.commentId FROM thumb WHERE thumb.userId = ?");
$exec   = $stmt->execute([$user['id']]);
$result = $stmt->fetchAll(\PDO::FETCH_COLUMN, 0);
$likes  = $result;

// echo "<pre>";
// print_r($likes);
// echo "</pre>";