Cant conenc to mysqli db

Website URL

(please specify the URL of the site on which you are experiencing the problem)

Error Message

(please share the FULL error message you see, if applicable)

Warning : mysqli_connect(): php_network_getaddresses: getaddrinfo for sql304.infinityfree.com failed: No address associated with hostname in /home/runner/MiniatureGrubbyBruteforceprogramming/index.php on line 13

Fatal error : Uncaught mysqli_sql_exception: php_network_getaddresses: getaddrinfo for sql304.infinityfree.com failed: No address associated with hostname in /home/runner/MiniatureGrubbyBruteforceprogramming/index.php:13 Stack trace: #0 /home/runner/MiniatureGrubbyBruteforceprogramming/index.php(13): mysqli_connect(‘sql304.infinity…’, ‘if0_36437274’, Object(SensitiveParameterValue), ‘\n if0_3643…’) #1 {main} thrown in /home/runner/MiniatureGrubbyBruteforceprogramming/index.php on line 13

Other Information

My Code:


<html>
  <head>
    <title>PHP Test</title>
  </head>
  <body>
    <?php
    $host  = "sql304.infinityfree.com";
    $username = "if0_36437274";
    $password = "HIDDEN BY MOD" ;
    $dbname = "
      if0_36437274_chatapp";

    $conn = mysqli_connect($host, $username, $password, $dbname);

    echo "conn";
?>
</html>

please resolve my issue as soon as possible

sorry the link is

shabbirnmapurwala[dot]great-site[dot]net

You shared your password publicly !

Change it to something else following this procedure

1

2

3

4 Likes

looks like you have a new line here \n
and you must not have any space

image

4 Likes

Remote DB connection is disabled on free hosting.

Try debugging directly on your actual website instead.

3 Likes

I have reset your hosting account password.

Please remember that this is a publicly accessible forum, which means all posts here are visible for everyone to see. So make sure that you do not publish any sensitive data here, like passwords.

Feel free to change it again if you want, just don’t reuse the previous password, because it’s compromised. You will likely have to update your code to use the new password.

4 Likes

btw. why such a username?

3 Likes

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