This can detect whether the program is at localhost or on the server, and connect mysql db accordingly.