Choosing the desired icon when fetching results
Extract Duplication to Function

You could try to extract some of the duplication:

getCheckIconHTML($color) {
    return "&lt;i style='color: " . $color . ";' class='fa fa-check'&gt;&lt;/i&gt;";
}


Now all the check icon HTML is in one place, which also makes it easier to change.

But the HTML really doesn't only depend on the color, but it also matters if it is clickable or not, so lets add that as well:

getCheckIconHTML($color, $isClickable) {
    $checkIcon = "&lt;i style='color: " . $color . ";' class='fa fa-check'&gt;&lt;/i&gt;";
    if ($isClickable) {
        $checkIcon = "&lt;a href='#'&gt;" . $checkIcon . "&lt;/a&gt;";
    }
    return $checkIcon;
}


Improve the ifs

Now, the foreach would look like this, which is already better:

foreach ($results as $result){

    if ($_SESSION['id'] == $author_id) {            // User is logged
        if ($result['id'] == $AcceptedAnswerId) {
            $AcceptAnswerIcon = getCheckIconHTML('green', true);
        } else {
            $AcceptAnswerIcon = getCheckIconHTML('grey', true)
        }
    } else {      // User isn't logged
        if ($result['id'] == $AcceptedAnswerId) {
            $AcceptAnswerIcon = getCheckIconHTML('green', false);
        } else {
            $AcceptAnswerIcon = null;
        }
    }
}


But now that we have the function, we can also restructure the ifs to get this:

$isUserLoggedIn = ($_SESSION['id'] == $author_id);
if ($result['id'] == $AcceptedAnswerId) { // There is accepted answer
    $AcceptAnswerIcon = getCheckIconHTML('green', $isUserLoggedIn);
} else {
    $AcceptAnswerIcon = $isUserLoggedIn ? 
            getCheckIconHTML('grey', true) : null;            
}


Misc


you don't need the $_SESSION['id'] !== $author_id check in the elseif. You already checked it in the if, so you know that the user is not logged in. If the last else is entered, something went wrong.
variable names should start with a lower-case letter.
your spacing is sometimes off.
I would move the code that checks if a user is logged in into a user class or something. If you just have checks like this all over the place, it will be hard to change the functionality later on.