get_the_title and get_permalink outside of the Loop

use echo right before functions.

echo get_permalink($ancestorsID[0]); echo get_the_title($ancestorsID[0]);

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