php codes ruins shortcode structure

You need to change the_title() to get_the_title().

You are asking the shortcode to echo out a string that is returning the title.

It would be good for you to research the difference between the_title and get_the_title.

The main difference is that the_title is actually returning the title without any other requirement (this is simplified: there are filters happening as well) but it is why you see it first before the rest of the code.

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