Adding link for logged in user? [closed]

<?php 
if ( is_user_logged_in() ) {
    $current_user = wp_get_current_user();
    echo '<a class="btn" href="https://wordpress.stackexchange.com/author/" . 
        $current_user->display_name . 
        '">Channel</a>'; 
} else { 
    echo 'Welcome, visitor!'; 
} 
?>

Note that get_currentuserinfo() is deprecated in favour of wp_get_current_user().

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)