Jump to content

Password Function


garyblackpool

Recommended Posts

hi,I have been making a mysql database with the password column used password function but when i queried it returned empty result. But when i changed it to use the md5 function it worked.I'm just wondering if anyone could tell me why that happened.

SELECT * FROM alc_user WHERE username = 'mandy' AND pass= MD5('beer')

SELECT * FROM alc_user WHERE username = 'mandy' AND pass= PASSWORD('beer')

Link to comment
Share on other sites

The obvious answer would be that the password is stored using MD5 and the password function does not use MD5.

NoteThe PASSWORD() function is used by the authentication system in MySQL Server; you should not use it in your own applications. For that purpose, consider MD5() or SHA1() instead. Also see RFC 2195, section 2 (Challenge-Response Authentication Mechanism (CRAM)), for more information about handling passwords and authentication securely in your applications.
Link to comment
Share on other sites

The obvious answer would be that the password is stored using MD5 and the password function does not use MD5.
Oh okay. It wasnt so obvious to me cos on phpmyadmin used the password function to save the pass, so i thought that it would get the pass.Thanks
Link to comment
Share on other sites

Archived

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

×
×
  • Create New...