If you have a different connection for your local testing and the live server then you should make a copy of the localhost.php file in the connections folder. In the copy of this file you will need to enter the details for your live database. When you upload the files make sure to upload this copy of the connection file to your live server and remove the local version.
This way you will be able to use your testing server and still get the files to work on your live server, you just need to maintain the two different versions of the localhost.php file.