Error establishing a database connection for some files

This is most likely a file permission issue on the server. If the file is visible on the file system but not rendering properly in the browser it typically means:

1) The web server (apache, iis, nginx) can’t see the file because it’s assigned to the wrong owner:group or the permissions are set too restrictively on the file itself.

2) The web server can see it but is not sure how to properly process/respond to the request (for example a .php file but PHP isn’t running on the server).

My guess is #1 since you said some of your pages work and others don’t.