Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
|
The point is, that the PHP script has to know where to connect to a db.
When the script runs on your host server, "localhost" referes to the server itself, which is where the database resides too 99% of time.
But, when you download the files to your computer, or a computer in your local network, the database is not repatriated, so the "localhost" is not the good database server anymore.
That's probably where your error lies.
You can either replace the occurences of "localhost" or "127.0.0.1" in the PHP mysql connect string to the IP of your server.
But it may fail if the mysql server is not configured to allow connection from another address than localhost.
Or you need to get a "dump" of the datas in your database, and to restore them on a mysql instance that will run on the same server as your files are on.
Then, "localhost" will refer a valid instance of the database agin.
__________________
Only a biker knows why a dog sticks his head out the window.
|