Function to check if custom page is used by page?

You can give this a try.

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

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