Adding code before any page loads

The correct way to do this would be to wrap your custom functionality in a function and hook it to init.

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