wp_get_attachment_link to add title attribute to link tag around image

I found a solution. Since the wp_get_attachment_link does not seem to work I solved this within an already used other filter:img_caption_shortcode

Within this filter function the content variable contains the image link tag. Here a just added the title using a simple search and replace:

$content = str_replace("<a","<a title="".$attr["caption'] . $credit."'", $content);

This way it works perfectly.

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