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

 

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.