bofett Posted June 20, 2010 Share Posted June 20, 2010 There must be a simple way to handle this. I updated my php site to include md5 for passwords. Now I need to go through and change all of the existing passwords to md5 so the current users won't be impacted. I was thinking of running something like one time: $qrl = mysql_query("SELECT * FROM users"); while( $row2 = mysql_fetch_object($qrl) ){ $oldpassword = $row2->password; $newpassword = md5($oldpassword); mysql_query("update users SET password=$newpassword"); } Thanks for your help. Quote Link to comment https://forums.phpfreaks.com/topic/205287-calling-data-changing-it-then-updating-the-change-in-the-table/ Share on other sites More sharing options...
trq Posted June 20, 2010 Share Posted June 20, 2010 A simple.. UPDATE users SET `password` = MD5(`password`); Will do. Quote Link to comment https://forums.phpfreaks.com/topic/205287-calling-data-changing-it-then-updating-the-change-in-the-table/#findComment-1074532 Share on other sites More sharing options...
bofett Posted June 20, 2010 Author Share Posted June 20, 2010 Thank you, thank you, thank you! A simple.. UPDATE users SET `password` = MD5(`password`); Will do. Quote Link to comment https://forums.phpfreaks.com/topic/205287-calling-data-changing-it-then-updating-the-change-in-the-table/#findComment-1074533 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.