Fatal error: Uncaught mysqli_sql_exception: Access denied for user 'username'@'localhost' (using password: YES) in E:\New folder\htdocs\Online Property Sales System\Src\html\register.php:10 Stack trace: #0 E:\New folder\htdocs\Online Property Sales System\Src\html\register.php(10): mysqli->__construct('localhost', 'username', 'password', 'Property_Lanka') #1 {main} thrown in E:\New folder\htdocs\Online Property Sales System\Src\html\register.php on line 10
<?php $servername = "localhost"; $username = "username"; $password = "password"; $dbname = "Property_Lanka"; // Create connection $conn = new mysqli('localhost','root','','Property_Lanka'); // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } $sql = "INSERT INTO MyGuests (`fname`, `lname`, `Pass`, `mno`, `dob`, `email`) VALUES('$fname','$lname','$pass','$mno','$dob','$email')"; if ($conn->query($sql) === TRUE) { echo "New record created successfully"; } else { echo "Error: " . $sql . "<br>" . $conn->error; } $conn->close(); ?>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)