简体   繁体   中英

How to ensure registration form is unique for each user rather than the same username or email or address etc?

I want my registration form to make sure that if the username already exists in my local storage, the user will not be able to register unless they change their username to something that hasn't been taken. Any ideas? I have already done nearly everything but just that part im stuck on.

Before storing the details to your database, run a query to check if username exists in the database. First, the query should be directed only to the username row, then use a loop to check if the newly inputed username is in the database. If it is, just tell the user to change username.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM