Jump to content

Calling data, changing it then updating the change in the table.


bofett

Recommended Posts

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.

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.