Cannot upload dynamic website

Website URL

( 2krs-construction.free.nf)

Error Message

(Connection failed: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo for sql313.infinityfree.com failed: Name or service not known)

Other Information

(i tried to follow the tutorial on youtube to change all the connection in server but it still doesnt work and i always get this error message)

Are you able to access phpAdmin?

1 Like

I had a quick look at your code and I see the issue.

In your code, you have defined the database hostname like this:

$servername = "sql313.infinityfree.com	";

There is another tab character at the end of the hostname. And yes, that matters. Extra characters, even if it’s just whitespace, will change the value and make it invalid.

If you remove the extra whitespace characters, your code should just work.

4 Likes

yes i import my database on cpanel mysqldatabases

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.