Starlyvil - 12:51 pm on Jan 4, 2012 (gmt 0)
It's as simple as this, when you are working with your local machine, your local machine is your Localhost. So now when connecting to your database, the database server name, username and password by default have to 'Localhost', 'root', and an empty string ''. By setting it to this you'll be connected successfully to your database without any error. But after uploading your website, you upload to a webserver and not a Local machine so the database server name, username and password won't be the same, and any connection to the webserver database using your local machine details won't connect and would give an error message. To correct this, you have to replace the database server name, username, and password with the ones given to you by your host service provider before uploading them, when this is done you won't get any error message when connecting to your database online.