the_author function is displaying wrong name and url

Sorry, but I found the answer very quickly myself and I attempted to delete this original question, but I think maybe somebody else may need this answer.

This is right code to solve this issue:

<h1 class="page-title">  <?php echo '<a href="'.get_author_posts_url(get_userdata($posts[0]->post_author)->data->ID).'">'.get_userdata($posts[0]->post_author)->data->display_name.'</a>'; ?></h1>

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