Password Protect Pages Not Working

Replace all of this:

$my_postid = get_page( $page_id );//This is page id or post id
$content_post = get_post($my_postid);
$content = $content_post->post_content;
$content = apply_filters('the_content', $content);
//$content = str_replace(']]>', ']]>', $content);
echo $content; 

…with this:

the_content();

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