Home  >  Article  >  Backend Development  >  Solve the problem of duplicate unique index in thinkphp (picture)

Solve the problem of duplicate unique index in thinkphp (picture)

黄舟
黄舟Original
2017-04-01 09:11:021579browse

The following editor will bring you an article that perfectly solves the problem of thinkphp's only indexduplicate error. The editor thinks it is quite good, so I will share it with you now and give it as a reference for everyone. Let’s follow the editor and take a look.

For example, the following fields (g_check_id): unique index

Solve the problem of duplicate unique index in thinkphp (picture)

Ifinsert data If the same value appears when (g_check_id), the program itself will report an error.

So do something like the following:

Solve the problem of duplicate unique index in thinkphp (picture)

The above is the detailed content of Solve the problem of duplicate unique index in thinkphp (picture). For more information, please follow other related articles on the PHP Chinese website!

Statement:
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