get author of published post

use

add_action('publish_post', 'rhb_check_current_user');

and in your rhb_check_current_user function check using the global $post:

function rhb_check_current_user(){
    global $post;
    $author_id = $post->post_author;
    ...
    ...
}

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