WordPress shortcode in content, output in sidebar?

If you wanna show the content in sidebar if current post content has the shortcode then you should try has_shortcode function. Here is a demonstration-

$content = get_the_content();
if( has_shortcode( $content, 'your-shortcode' ) ) {
    // The content has a [your-shortcode] short code, so this check returned true.
} 

Hope it helps.

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