This code works, but breaks the media uploader. How do I integrate it in a way that won’t?

Check if media html elements have previous classes, probably You removed some class from media window (button i guess) and some js functions can not be triggered like hide().

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