passing variables inside a widget add_action

Use the use keyword:

$title = $instance['title'];

add_action( 'wp_footer', function() use ( $title ) {
    echo  $title; 
});

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