Critical and persistent registration failure

Website URL

http://stardoctornode.xo.je/

Error Message

:cross_mark: Registration failed due to a database error: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘’ for key ‘email’

Other Information

The users table schema is corrupted. The error indicates a duplicate entry on the unique key email, but the column email does not exist in the table (and has been removed from all PHP code). This is a phantom constraint. We also confirmed the reg_no column is either missing or causing the same conflict, as all attempts to register students fail due to a constraint violation being misreported as email. We cannot drop the phantom index because phpMyAdmin is unavailable. Please clear the index cache for the users table or manually execute SQL commands to drop any unique index associated with the phantom email key or the reg_no column.
  1. Free hosting have phpMyAdmin. If you cannot access it please see Unable to access phpMyAdmin.
  2. Removing a reference from your PHP code doesn’t mean it doesn’t exist in the database. In fact, the error message makes me think that it is exactly because you don’t refer to the column in PHP, the database always receive an empty value for the email, and thus raise the constraint violation.
  3. Your inquiry is way too out of scope for the community forum. We won’t and cannot fix your code for you.
6 Likes

I very strongly doubt that you’re getting a duplicate key error for a column that does not exist in a table and a field you’re not entering in a query.

phpMyAdmin is working fine from here, and you should be able to access it to troubleshoot and solve your issue.

Could you please:

  1. Try to get access to phpMyAdmin again. If you’re having trouble with that (and the guide that @Meishin referred to didn’t help), please tell us what exactly you’re having trouble with. That might seem out of scope for the issue you’re having, but I’m not going to do or check things for you that you should be able to do yourself.
  2. Verify your database schema through phpMyAdmin.
  3. Reproduce the query you’re running from your website as a SQL statement, and try running that from phpMyAdmin.

If you’re able to reproduce the issue in this way, then please share the database schema, the name of the database and the table, and the query you’re trying to execute on it so we can check it.

7 Likes

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