piyush23424 Posted June 4, 2010 Share Posted June 4, 2010 Hello, I am using the following query to insert username and password in the database : $qry = "insert into users(`username`,`password`) values('testName', PASSWORD('admin'))"; Query is running fine. but the problem is it is inserting different hash codes in xampp and wampp for 'admin' as password. According to me PASSWORD function must create the same hash values in xampp and wampp for 'admin' Please tell me the reason if anybody knows Thanks Quote Link to comment https://forums.phpfreaks.com/topic/203862-password-function-is-generating-different-values-in-xampp-and-wampp/ Share on other sites More sharing options...
Alex Posted June 4, 2010 Share Posted June 4, 2010 You should not rely on the mysql PASSWORD() function exactly for this reason. The hash returned by PASSWORD() was changed from 16 to 41 bytes in MySQL 4.1. Instead you should use a hasing function that you know will not change. Two such functions are md5 and sha1. Quote Link to comment https://forums.phpfreaks.com/topic/203862-password-function-is-generating-different-values-in-xampp-and-wampp/#findComment-1067735 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.