Comment Function

the function you posted is limited to 5 comments which means it should work, but anyway there is no need for a custom SQL query when you can use the native get_comments function

function showLatestComments() {
    $comments = get_comments(array(
        'status' => 'approve',
        'number' => '5'
        )
    );
    $output .= '<h2>Latest student perspectives <img src="https://wordpress.stackexchange.com/wp-content/themes/blue-and-grey/images/hmepage-tri.png" class="class3" /></h2>
    <ul id="comm">';  
    foreach ($comments as $comment) { 
        $output .= '<li><strong>'. $comment->comment_author . ' said</strong> : "' . substr(strip_tags($comment->content),0,99). '..."</li>';
    }
    $output .= '</ul>';  
    echo $output;  
}//end function