Get attachment file link

Well, there is a WP function for that.

wp_get_attachment_url

It takes attachment id as argument, so you can use it like in following example:

echo wp_get_attachment_url( 12 );

This will echo url to attachment which id is 12.

You can find more info and examples on Codex page:
https://codex.wordpress.org/Function_Reference/wp_get_attachment_url

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