Passing global variable from header.php to functions.php

is_single() is a function returning a boolean value. You could simply use it for your conditional check rather than passing the global variable.

Other than that, your first line of code should be setting $my_global_var with a single equal sign, i.e.: $my_global_var = true;.

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