if statement in sidebar.php checking page id or template or title

Simplify your code for a test

if (is_page_template('news-page.php')) { ?>
    <p>yes!</p> 
    <?php } else { ?>
    <p>not 'news-page.php'</p>         
     <?php }

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