Fail to get the total number of posts

This is basic PHP string concatenation

echo 'Total posts: '; $published_posts;  

Should be

echo 'Total posts: ' . $published_posts;  

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