How to add some php code in header.php using plugin

Looks like just syntax:

add_action( 'wp_head', function(){ 
    ob_start();
}

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