Hello all, Okay so I am using XAAMP and I have no problem viewing my site on my local machine but being that this is my first testing server setup and I am only about two years into programming as well, I am having trouble with the database connection. Obviously the code in my pages is for connecting to the database on the real server..and in terms of on the live server it works great! Forgive my ignorance here but do I have to change the code to connect to the database on the testing server? I am really clueless as to how to get the connection to work. I have been developing live to this time (I know, its a bad idea, but Hey I am trying to change that now!) So any database-connection-on-testing-server help is appreciated!
You do not need to change the code but the connection settings In order to connect to a db you will need the host on which the db is (often it is localhost but sometimes depending on the host you end up having things like db345.domain.com), a username with password, and the db name. So since you run it on a local server I would say you need the host to be localhost, username and password to be the one that you use then you log into the local phpmyadmin and the db name to be the database you want to work with.
so if I am working in my testing environment I just need to change all the db connection settings...then when I am ready to upload my changes to the real server do I just change the settings back or is there some simpler way so I don't always have to go in there and flip flop the settings?
Trying to get this setup as soon as possible any additional insight from anyone appreciated. EDIT...just had another site...is the standard way for doing this just to have a testing copy of the site and the regular copy...then when the testing version works out you just overwrite the regular local files and upload? That doesn't seem all that efficient either though.