Do shortcode that is inserted in a textarea is not displaying properly

You should be returning $location from get_location, instead of echoing it. Your function currently echos the location as soon as it runs, thereby outputting the result before the rest of the copy.

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