terryds Posted June 4, 2013 Share Posted June 4, 2013 Please tell me how to prevent the user from multiple sign upI am i don't want there are the same usernames...Please tell me how to do that, so the id and the username are unique... Link to comment Share on other sites More sharing options...
justsomeguy Posted June 4, 2013 Share Posted June 4, 2013 Check if it exists in the database before adding it. Link to comment Share on other sites More sharing options...
terryds Posted June 5, 2013 Author Share Posted June 5, 2013 I'm surprised with that answer... I see that many many web applications don't allow the user to make another account with the same name....Can you tell me how to do that? Link to comment Share on other sites More sharing options...
Don E Posted June 5, 2013 Share Posted June 5, 2013 For instance, you can check if the users' email address is already in the database table... if it is that means that particular user is already signed up. Link to comment Share on other sites More sharing options...
terryds Posted June 7, 2013 Author Share Posted June 7, 2013 (edited) Solved! I found this myself... Use 'Unique' ! ADD UNIQUE 'column' Edited June 7, 2013 by terryds Link to comment Share on other sites More sharing options...
justsomeguy Posted June 7, 2013 Share Posted June 7, 2013 You can make it a unique index, but that's just going to cause a database error when you try to add a duplicate row. If you don't want your script to fail with a database error then do what everyone else does and check if a record already exists before adding the new one. Then you can give your own error message to the user instead of your script just failing. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now