Error with the site

Username (e.g. epiz_XXX) or Website URL


Error Message

I don’t know how to generate an error message since i tried using alter php config in cpanel however that didn’t change anything. Essentially the problem im having is with connecting to the mySQL database. when i run this following bit of code

<?php $hostName = ""; $dbName = "epiz_31292830_SportsRealm"; $userName = "epiz_31292830"; $password = "*************"; try { $pdo = new PDO("mysql:host=$hostName;dbname=$dbName",$userName,$password); $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); echo "Connected successfully"; } catch(PDOException $e) { echo "Connection failed: " . $e->getMessage(); } ?>

I end up with the error Connection failed: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo for failed: No such host is known.

I assume this means that i wasn’t able to successfully connect to the database.

Any help is greatly appreciated, since my grade will depend on this

nevermind, after further testing it seems i was get it working

1 Like