How to detect if some page template has been selected

sure it is possible. Just check the page meta field (assuming you’re in the loop):

$template = get_post_meta( get_the_ID(), '_wp_page_template', true );

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