I keep seeing this error on the line containing the fetch Values line. Error is: Parse error: syntax error, unexpected 'while' (T_WHILE)
Can anyone see what I have done incorrect here?
<?php
    /* prepare statement */
    if ($stmt = $link->prepare("SELECT DISTINCT ticket.TicketuserID, user.UserName,  count(*) AS counter
    FROM ticket
    INNER JOIN user
    ON user.userID= ticket.TicketuserID 
    WHERE `TicketStatus` LIKE 'Active'
    GROUP BY ticket.TicketuserID, user.UserName
    HAVING COUNT(*) >= 1")) {
    $stmt->execute();
    /* bind variables to prepared statement */
    $stmt->bind_result($TicketuserID, $UserName, $counter);
    /* fetch values */
    while ($stmt->fetch()) {
        printf("<a href=\"ticketlist.html\" class=\"list-group-item list-group-item-action\">" . $UserName. " - " . $counter. "</a>");
        //printf("%s %s\n<br>", $UserName, $counter);
    }
        /* close statement */
            $stmt->close();
        }
        /* close connection */
        $link->close();
        ?>
 
     
    