Check if post is in draft or pending review?

post_status is part of the $post object which you can use to determine if it is published, a draft, pending, etc.

if( $post->post_status == 'pending' )
    // do stuff

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