WordPress transient doesn’t use the transient

I mean in shortly your code is wrong in the first line, the comparing is wrong. The variable $post should store = the data of the request via get_transient() and not compare ===.

So you should switch to:

if ( false === ( $posts = get_transient('posts_array') ) ) {
    // this code runs when there is no valid transient set
}

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