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