well, at first glance, I would suggest you check your mysql logs. the code you are commenting out to solve the problem is mostly mysql code.
I would never make the assumption "My project has no errors in it". Especially when you run the code and get 'Error 101 (net::ERR_CONNECTION_RESET): Unknown error.' in response. I would assume you have had the error the whole time but your server at school is not reporting errors and it is on code that doesn't really matter like 'mysql_free_result($resource);' or something like that.
Good luck... nothing more fun than microsoft esque cryptic error codes.