I was just searching for the most proficient way to only allow a specific email to be inserted into my database only one time, upon a user creating an account with their unique email. I’m assuming it’s a simple if statement that triggers an error message if attempted.
Is this only possible via php or is there a mysql shortcut to accomplish this?
Just add the UNIQUE index to the email field in the database.
See this.
UPDATE
Ok, so now that you’ve explained your problem a bit more accurately, I’d suggest you still keep the email field
UNIQUEin the database, but add some user-friendly notifications for users trying to create an account using an existing email address. You can do this like showing them a popup saying that the address is already in use, suggest them to reset the password in case they’ve forgotten it, etc.