My shortcode is showing up twice

This is more about php than wp, but ob_get_contents returns the buffer without clearing it. So you get your buffer content twice. Use ob_get_clean to erase the buffer on returning it.

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