I can't link my database

The truth is I don’t know what’s happening now, I’ve previously managed to connect my page to the database, but now it won’t let me, I’ve already tried changing some things in the account and so on, but I can’t connect, I get the following error, no I know if it works for you, but even so I made sure I had the name of the database and those details right, but it still fails

Warning : mysqli_connect(): php_network_getaddresses: getaddrinfo for sql301.infinityfree.com failed: Host desconocido. in C:\Users\User\Desktop\pagina web final\php\conexion_be.php on line 5

Fatal error : Uncaught mysqli_sql_exception: php_network_getaddresses: getaddrinfo for sql301.infinityfree.com failed: Host desconocido. in C:\Users\User\Desktop\pagina web final\php\conexion_be.php:5 Stack trace: #0 C:\Users\User\Desktop\pagina web final\php\conexion_be.php(5): mysqli_connect(‘sql301.infinity…’, ‘if0_35906114’, Object(SensitiveParameterValue), ‘if0_36597932_us…’) #1 {main} thrown in C:\Users\User\Desktop\pagina web final\php\conexion_be.php on line 5

This is expected

3 Likes

This is the second website that I am creating, in the previous one everything worked well, this current one is the one that has problems and I have done everything the same, that is why I am destined to ask

No, definitely different.
Database on free hosting can only be connected through hosting account.

is definitely not

2 Likes

Warning : mysqli_connect(): php_network_getaddresses: getaddrinfo for sql301.infinityfree.com failed: Name or service not known in /home/vol17_1/infinityfree.com/if0_36597932/htdocs/php/conexion_be.php on line 5

Fatal error : Uncaught mysqli_sql_exception: php_network_getaddresses: getaddrinfo for sql301.infinityfree.com failed: Name or service not known in /home/vol17_1/infinityfree.com/if0_36597932/htdocs/php/conexion_be.php:5 Stack trace: #0 /home/vol17_1/infinityfree.com/if0_36597932/htdocs/php/conexion_be.php(5): mysqli_connect(‘\tsql301.infinit…’, ‘if0_36597932’, Object(SensitiveParameterValue), ‘if0_36597932_pr…’) #1 /home/vol17_1/infinityfree.com/if0_36597932/htdocs/php/registro_usuario_be.php(3): include(‘/home/vol17_1/i…’) #2 {main} thrown in /home/vol17_1/infinityfree.com/if0_36597932/htdocs/php/conexion_be.php on line 5

Read on

2 Likes

I don’t speak English, I speak Spanish, that’s why it’s more of a problem hahaha

I checked the specific file, and this is how you have set the hostname:

image

There is a lot of extra whitespace between the starting quotes and the actual hostname. And yes: that matters. It changes the hostname and results in a different value that does not work.

Please make sure to use the exact values provided to you, configured in exactly that way. Even seemingly insignificant changes can break it.

5 Likes

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