Current URL path variable

You could just get the permalink and strip the home root from it-

$path = substr( get_permalink(), strlen( home_url("https://wordpress.stackexchange.com/") ) );

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