The site is working again at the moment. Maybe the complicated SQL statement did cause it after all, I discovered several database connections that were stuck on it after I restarted the DB process. I removed the file that contained this statement from the server though so hopefully nobody will be able to access it now. I'll monitor it closely in the next 24 hours.
I've been playing around with the web site and it runs smoothly.
When you can spend some time with this, please tell me if what I suggested to you by PM worked and check if those lines I told you from the statement are causing some trouble.
BTW, great job!!