Using an “IF” statement based on the existence of custom field

I think this should help

if ( get_post_meta( $post->ID, 'name_of_the_custom_field', true ) ) :
    // Do something
endif;

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