How to remove the automated code posted in functions.php?

You could always diff your most recent working backup with the infected website. You do have a backup don’t you?

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