Http error 500

Comparing the error message against the article Common MySQL Connection Errors, this means your code is using localhost as the database hostname. That’s not correct, our database hostnames look like, where XXX are numbers that vary depending on the account. Please check your client area or control panel for the value to use.

I don’t need to see the code for that. A No such file or directory error with MySQL always means you’re using localhost as database hostname.

All the errors after that are just the result of not having proper error checking in your code. It’s trying to run a database query on a connection that doesn’t exist, and fetching results from a query that could not be executed.

Assuming there are no other errors, using the correct database name should make those errors disappear too.