How to get blog_id of an MU site when running a custom function on the parent site

You need to use the global $current_blog instead.

$GLOBALS[‘current_blog’]->blog_id

will return the correct id.

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