WordPress pages are not published due to External database connection with WPDB class

After establishing the connection to “your” DB and doing all the required work you need to reestablish the connection to the DB wordpress uses. Just keeping the object around is not good enough.

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