Current path on page in functions.php

//get current page's path
$pagePath = parse_url( $_SERVER['REQUEST_URI'] );
$pagePath = $pagePath['path'];
$pagePath = substr($pagePath, 1, -1);//remove slashes

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