PDA

View Full Version : MD5 encryption


greens85
08-03-2009, 04:11 PM
Hi All,

I know you can change a password to m5 through phpmyadmin by clicking on single record & choosing md5() under function but is it possible to change all records in the table at once?

thanks

abduraooft
08-03-2009, 04:24 PM
You might have got the code to update all your records, if you had checked the generated code(under SQL query: ) by phpmyadmin for your single row update operation

greens85
08-03-2009, 04:29 PM
You might have got the code to update all your records, if you had checked the generated code(under SQL query: ) by phpmyadmin for your single row update operation

The query generates:

UPDATE `educavac_jobvac`.`jobseekers` SET `upass` = MD5( 'password' ) WHERE `jobseekers`.`jobseekerid` =12 LIMIT 1 ;

Which would pressumably be changed to:

UPDATE `educavac_jobvac`.`jobseekers` SET `upass` = MD5( 'password' ) WHERE `jobseekers`;

But I have no idea where I would enter this for it to work :confused:

abduraooft
08-03-2009, 04:41 PM
But I have no idea where I would enter this for it to work There must a tab named SQL in between Structure and Search

greens85
08-03-2009, 04:47 PM
There must a tab named SQL in between Structure and Search

Ah right now I see it...

What would I enter for the passwords for each tho?

For example when i posted that example:

UPDATE `educavac_jobvac`.`jobseekers` SET `upass` = MD5( 'password' ) WHERE `jobseekers`;

('password') actually contained that users password but if im updating multiple records then all passwords will be different:

Would I just use something like this:

UPDATE `educavac_jobvac`.`jobseekers` SET `upass` = MD5( '' ) WHERE `jobseekers`; ?

abduraooft
08-03-2009, 04:56 PM
UPDATE `table_name` SET `password_field` = md5( `password_field` )

greens85
08-03-2009, 05:00 PM
UPDATE `table_name` SET `password_field` = md5( `password_field` )

Ah right.... many thanks for the help! Much better than doing it one by one, lol!