PHP - pdo prepare select

    
        $db->beginTransaction();
        $stmt = $db->prepare("SELECT * FROM `post` WHERE `id` = :id");
        $stmt->execute(['id' => $id]);
        $post = $stmt->fetch(PDO::FETCH_ASSOC);
        $db->commit();