Not passing correct value to get_post_ancestors?

EDIT

$thisid can be passed as an array, as get_post_anscestors().

So try $ancestors = get_post_ancestors( array( $thisid ) );

I misread; it does accept strings, but maybe give an array a shot.

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