Domain Empire

Make sure user doesn't exist...

Spaceship
Watch
Impact
20
hi im building a user system and its all working except the bit where the user already exists

anyone got any ideas how i should go about checking for duplicate users
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
Not sure if theres any special way of doing this, but I take it your checking for duplicate users every time someone logs into the system. If I am correct in assuming this you could simply add a boolean field called 'logged_in' to your database where you check your passwords. eg.

user already logged in = 1
user not already logged in = 0

Check this field every time a user tries to log in. If its set to 0 log the user in and set the field = 1. If the user is already logged in (field = 1) redirect the user to another warning page.

Not sure if thats any help just made it up of the top of my head there now.
 
0
•••
thanks ive sorted it, not sure if i took the long way round but when i add a user it trys to select that user from the database if it does then then errors if it doesnt select it it adds it
 
0
•••
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back