使用 php 编辑用户个人资料时检查重复的电子邮件
Checking duplicate email while editing user profile using php
使用 php 编辑用户个人资料时检查重复的电子邮件
我如何查看电子邮件在另一个用户个人资料中不可用。
您像这样使用 select 查询:
select 1
from users
where email = 'new_email_address@example.com'
and id <> id_of_user_editing_their_profile -- this is the important bit
如果它 returns 一行或多行,则其他用户正在使用指定的电子邮件。
使用 php 编辑用户个人资料时检查重复的电子邮件 我如何查看电子邮件在另一个用户个人资料中不可用。
您像这样使用 select 查询:
select 1
from users
where email = 'new_email_address@example.com'
and id <> id_of_user_editing_their_profile -- this is the important bit
如果它 returns 一行或多行,则其他用户正在使用指定的电子邮件。