Find post tags words in post content and link them to tag URLs

You can use power of PHP. Explode the Words and Implode them.
After exploding it you will get an array, with which you can loop through using foreach and call your function conditionally.

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