has_term not returning anything

If your second code block is in the same code block as your first, then adding $post->ID as the third parameter of the has_term() call should fix it:

if ( has_term( 'closed-captions', 'accessibility-options', $post->ID ) ) { echo 'CC'; }

If it doesn’t then as Tom mentioned, please update your question to include the surrounding relevant code.

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