Jump to content

Best way to check if a user already exists...


paulferree

Recommended Posts

You guys were so awesome & quick on my last question I figured I'd let you field another one! :-)

 

What is the best method/logic (I don't necessarily need the code) for checking to see if a username already exists in a database table?

 

I have a feeling it's a lot easier than what I'm thinking.

 

Would I do a query: SELECT username FROM table WHERE username = $username

and if it produced and error (or is not found) go ahead and create the record...if the query actually resolves then display a message saying the user already exists.

 

Is that right?

 

Paul

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.