Something goes wrong in db

What i wanna do:

store php form in sql database

sitte url


Error Message:

"php_network_getaddresses: getaddrinfo failed: Name or service not known "
idk where is the problem did i do something wrong??


$conn = new mysqli($dbhost, $dbuser, $dbpassword, $dbname);

if($conn == false){
    die('error' . $conn->connect_error);


    $Fname = htmlspecialchars($_POST['Fname']);//varchar
    $Lname = htmlspecialchars($_POST['Lname']);//varchar
    $Cname = htmlspecialchars($_POST['Cname']);//varchar
    $Uemail = htmlspecialchars($_POST['Uemail']);//varchar
    $Unum = htmlspecialchars($_POST['UCnum']) . htmlspecialchars($_POST['Unum']); //int
    $UTA = htmlspecialchars($_POST['UTA']);//varchar

$sql = "INSERT INTO userInfo (Fname, Lname, Cname, Uemail, Unum, UTA) VALUES ('prova', 'prova', 'prova', 'prova', '11', 'prova') ";

This normally means there was an error finding the database server. Can I ask what you are using as your database server?

What is the value of $dbhost in your script? Does it match the value of the MySQL Hostname in the client area and control panel?

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