Hi Team
I am having a problem with my back end, i am using php to register new users but somehow its not registering them instead it throws an exception i created for password incorrect.
// Back end
0)
{
$exists="Username not available";
}
}//end if
?>
Success! Your account is
now created and you can login.
Lokesh VarmanPosted Feb 27, 2023, 8:36 AM
It's difficult to determine the exact cause of the issue without seeing the error message, but it looks like you're checking if the username already exists in the database, and if it doesn't, you're checking if the passwords match before inserting the new user.
One possible issue could be with the password hash generated using
password_hash(). Make sure that the column where you're storing the password in the database has enough space to hold the hashed password.Another issue could be with the SQL query itself. Make sure that the table name and column names are correct and match the names in your database.
You can also try adding some error handling code to print out the error message when the
mysqli_query()function fails. This will give you more information about the specific error that's occurring.Here's an example of how you can print out the error message:
Hope this helps!