Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Databse containing username and pass

Status
Not open for further replies.

axman505

Technical User
Jun 20, 2001
489
US
If i have a database containg username and pass where entries are inserted like this:

INSERT INTO `users` ( `user` , `pass` )
VALUES (
'user', PASSWORD( 'pass' )
);

How would i go about verifying this against a username and password used to log into something?
 
i solved my own problem .. i can simply to md5($password) to convert to the a md5 hash for comparison
 
You can also perform a query like:

SELECT count(user) FROM users WHERE pass = password(<user-given password>)

______________________________________________________________________
TANSTAAFL!
 
in my case that would read:

SELECT count(user) FROM users WHERE pass = md5(<user-given password>)
 
Are you inserting the passwords as md5 hashes? Your original post used MySQL's password() function. ______________________________________________________________________
TANSTAAFL!
 
sorry about that .. originally thats what i decided, but now im going with md5
 
So long as you match hashes.... ______________________________________________________________________
TANSTAAFL!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top