I am trying to create a signup script with PHP but I keep getting the same error Connection to database failed: Access denied for user 'emoisblack'@'localhost' (using password: YES)
. I have definitely cross checked to see if there is any typo, and everything seems correct. Still I get the same error. I tried deleting the user, dropping the database and the connection and doing the whole process with a new connection. All to no avail. I am adding my "database connect" code to the bottom of this post and also the signup script that adds new users to the database. I hope they help. Let me please know if any thing else needs to be clarified. Thanks in advance for any assistance.
dbconnect.php
<?php $conn = mysqli_connect("localhost", "emoisblack", "", "db_obank"); if (!$conn) {
die("Connection to database failed: ".mysqli_connect_error());}
signup.php
<?php include 'dbconnect.php'; $firstname = $_POST['firstname']; lastname = $_POST['lastname']; $username = $_POST['username']; $email = $_POST['email']; $pwd = $_POST['pwd']; echo $username;