I can not see that editing the header or footer file would in any way cut off your database connection. those files are template files.
You did only edit the temp[later filers correct?
If you upload the stock unedited files are you still getting the same error?