Checking duplicate email while editing user profile using php how i can check email is not available in another user profile.
CodePudding user response:
You use a select query like so:
select 1
from users
where email = '[email protected]'
and id <> id_of_user_editing_their_profile -- this is the important bit
If it returns one or more rows then some other user is using the specified email.