I recently installed WAMP to develop my website locally.
I’m new with PHP/MySQL and perhaps don’t entirely understand how connecting to mysql databases works with PHP.
How do most people set up their database locally? I assume that they mirror their production database tables.
If I need to connect to a server each time I do a SQL query (mysql_connect), and the development server is local but the real server is remote, how do I connect differently while testing and still be able to use that code?
Sorry if that’s not a good explanation. It seems that I would have to connect to localhost for testing, and www.example.com for production, which would require different code.
Answers or links to answers would be helpful!