Home > Database > Mysql Tutorial > body text

MySQL小技巧总结_MySQL

WBOY
Release: 2016-06-01 13:11:08
Original
974 people have browsed it
1.MySQL避免相同数据重复插入

若用户注册表有一列是email,避免相同email注册多个账号,那么就设置email为unique,这样就使email是唯一的,不会重复.

当插入的email和原来的一个email相同,则无法插入新的数据.

alter table table_name add unique email
Copy after login


source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template