‘global’ not working in wordpress?

Don’t use globals, but if you must use them you should explicitly declare them as such. WordPress includes theme files from functions therefor a $test = 1; will be evaluated in the context of the function and the variable $test will be implicitly declared in the context of the function but not as a global.

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