My website is: http://cafebay.epizy.com
The error I just see is
Warning : mysqli::__construct(): (HY000/1045): Access denied for user ‘epiz_25857987’@‘192.168.2.187’ (using password: NO) in /home/vol1_2/epizy.com/epiz_25857987/htdocs/custinfo.php on line 37
Connect Error(1045)Access denied for user ‘epiz_25857987’@‘192.168.2.187’ (using password: NO)
I tried checking my php code. It doesn’t have errors from it. I even checked if the host, database, password, and username is correct. But it all matches. I tried checking the forum here but the common probelm they occur is using password: YES. I don’t know what do to. Helpppppp
this is my php code
<?php
$lastname=filter_input(INPUT_POST,'lastname');
$firstname=filter_input(INPUT_POST,'firstname');
$email=filter_input(INPUT_POST,'email');
$website=filter_input(INPUT_POST,'website');
if(!empty($lastname) || !empty($firstname) || !empty($email) || !empty($website)){
$dbhost ="sql210.epizy.com";
$dbusername = "epiz_25857987";
$dbpass = "HIDDEN BY MOD";
$dbname = "epiz_25857987_customerinfo";
$conn = new mysqli($dbhost, $dbusername, $dbpassword, $dbname);
if (mysqli_connect_error()) {
die( 'Connect Error('. mysqli_connect_errno().')'. mysqli_connect_error());
}
else{
$SELECT = "SELECT email From custinfo where email = ? limit 1";
$INSERT = "INSERT into info (lastname, firstname, email, website) values (?,?,?,?)";
$stmt=$conn->prepare($SELECT);
$stmt->bind_param("s",$email);
$stmt->execute();
$stmt->bind_result($email);
$stmt->store_result();
$rnum=$stmt->num_rows;
if($rnum==0) {
$stmt->close();
$stmt=$conn->prepare($INSERT);
$stmt->bind_param("ssssssssssss", $lastname, $firstname, $email, $website);
$stmt->execute();
echo "New record inserted successfully.";
}
else {
echo "Email is already registered.";
}
$stmt->close();
}
}
else {
echo "All fields are required";
header("refresh:5; url=custentry.html");
die();
}
?>
Hello there,
Have you already checked out this Knowledge Base article?
Many websites use MySQL databases to store information and settings. However, there are some reasons why the connection to the database may fail. This article describes some commonly seen error messages when connecting to a database, as well as some...
2 Likes
Please change $dbpassword
to $dbpass
in connection function.
2 Likes
system
Closed
June 19, 2020, 6:36am
#6
This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.