Home > Backend Development > PHP Tutorial > Form validation in CI - unqiue

Form validation in CI - unqiue

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-09-02 08:57:06
Original
1381 people have browsed it

When it comes to is_unique in form validation, it goes directly to the database to query, but I want to exclude myself, what should I do?
For example, my username (unique field) is Beetle and the id is 1. When modifying user information, if I use unique directly, it will directly prompt that it is occupied. How can I exclude myself and check the uniqueness? That is, such a sql To verify the uniqueness - select username from xxx where username='Beetle' and id!=1
Thank you everyone

Reply content:

When it comes to is_unique in form validation, it goes directly to the database to query, but I want to exclude myself, what should I do?

For example, my username (unique field) is Beetle, and the id is 1. When modifying user information, if I use unique directly, it will directly prompt that it is occupied. How can I exclude myself and check the uniqueness? That is such a sql To verify the uniqueness - select username from xxx where username='Beetle' and id!=1
Thank you everyone

Related labels:
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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template