【发布时间】:2021-03-29 19:19:54
【问题描述】:
当我使用重复的电子邮件或唯一 ID 注册新用户时,我遇到了这样的错误:
致命错误:未捕获的 PDOException:SQLSTATE[23000]:违反完整性约束:1062 C:\wamp64\www\ITaidLibrary-8\registration_page.php:20 中密钥“email”的重复条目“asma@gmail.com”堆栈跟踪:#0 C:\wamp64\www\ITaidLibrary-8\registration_page.php(20): PDOStatement->execute(Array) #1 {main} 在 C:\wamp64\www\ITaidLibrary-8\registration_page 中抛出。第20行的php
如果它已经存在,我想显示一条消息;我该怎么做?
【问题讨论】:
-
这是你的代码还是你下载的不是你写的工具
-
如果是您的,请包含一个最小的可重现示例作为源代码。
标签: php duplicates unique fatal-error exists