开发者

cakephp inset violating unique constraint

using cakephp on email column in the db i have unique constraint, how can check before inserting record开发者_高级运维ing that email may be duplicate or after inserting detect and print error.


Check out the Core Validation Rules. There's one for isUnique.


Found another good example at http://www.davidtan.org/cakephp-tutorial-how-to-insert-records-into-table-with-unique-index-made-up-of-2-or-more-fields/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜