php - displaying message when theres duplicate entries not working

one text

Solution:

Isn't your UserId a generated value in your DB's schema ? If i understand correctly what you are trying to achieve, you shouldn't be able to know if your user_id already exist since you shouldn't have a user_id at the moment you are trying to execute your form.

Here's how i understand your page: You have a page, on this page there's a modal to add new user, in this page you verify if there's already an existing user with the same Email | Username | Id, but my issue is that you can't know the user_id of a user that hasn't been created yet, and also you shouldn't validate a duplicate based on an auto-generated value by your DB (imo)

I hope my message is understandable, what i want to say is that you can't verify the existence of something that hasn't been created yet.

Source