Jump to content

PASSWORD Function is generating different values in xampp and wampp :


piyush23424

Recommended Posts

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

 

 

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.

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.