注册时的主键声音 [英] Primary key voilation while register

查看:94
本文介绍了注册时的主键声音的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这次我需要一些建议。在我的项目中,我有一个包含字段的注册表(名字,姓氏,电子邮件,手机和密码)。当用户注册时,激活邮件将转到他正在注册的电子邮件地址,而在数据库表中,该列是(fname,lname,email,email,mobile,password,activation code)。电子邮件有主键。当用户注册邮件并且表填充激活码时,如果表列中存在激活码,则用户无法登录。电子邮件有一个链接,当用户点击链接时,它只是从表中删除激活码。这样用户就可以登录了。



我的问题是假设从用户收件箱中错误地删除了电子邮件,那么他无法登录,因为激活码仍然存在在DB列中,当他尝试再次使用相同的电子邮件ID注册时,由于主键错误而来。



给我建议我该怎样做再次注册同一封电子邮件如果激活电子邮件被删除但我想要电子邮件列中的主键。

This time i need some suggestion. In my project i am having a registration form with fields(first name, last name, email, mobile and password). when user register, a activation mail is goes to the email address he is registering with and in database table the column is(fname, lname, email, email, mobile, password, activation code). Email is having primary key. When user register mail goes and table filled with activation code, If activation code is present in table column then user not able to login. The email has a link, when user click on link it simply delete the activation code from the table. So that user able to login.

My problem is suppose if the email is deleted by mistake from user inbox then he is not able to login because activation code is still present in DB column and when he is try to register again with same email ID then due to primary key error comes.

Give me suggestion what can i do to register again with same email if the activation email got deleted but i want primary key in email column.

推荐答案

当用户登录时,如果激活了激活码字段,则给用户2个选项可供选择:

1.转到他的电子邮件激活帐户;或者

2.重新发送新的激活码
When a user logs in, if activation code field is filled, give the user 2 options to choose:
1. Go to his email to activate the account; or
2. Re-send a new activation code


这篇关于注册时的主键声音的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆