Get WordPress username to customize url

You can only do that if the user is logged in (otherwise there is no “current” user). Depending on what your specific use case is, it would be something like this:

if ( is_user_logged_in() ) {

    global $current_user;
    $current_user = wp_get_current_user();

    // get the username:
    $username = $current_user->user_login;

    // set up the URL:
    $url = home_url( $username );
}

Here’s the documentation on the core WP functions I used above:

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