It looks like $_SERVER["SERVER_NAME"] is not defined on your server. Which is odd. It implies a server configuration issue of some sort. Are you using a dynamic connection, or do you test on your live server? That code is used to identify the server the code is running on and change the connection based on the server name. You could try setting the value programmatically or deleting that IF statement to get around the issue, or talk to your hosting provider to see if they can update the server so that it is properly defined.