...

View Full Version : Re-creating Table Values



Troy297
03-23-2007, 01:29 AM
Hey All,

I have just finished making a v3 for one of my scripts on my site and now I am running into a problem when trying to create the upgrader. See in v3 I used md5 encryption for passwords and etc, so I now need a query that I can run on my MySQL Database that will basically go through a specific table and take every entry for "passwrd" (yes passwrd not password) and md5 encrypt it and then re-enter it into the database.

I know how to do the basic selecting, deleting, updating, etc but I didn't know how I would go about doing this for an entire table.

Actual code would be great! Thanks in advance for any help!

iLLin
03-23-2007, 02:26 AM
just dont use a where statement, it will then apply to all rows.

Inigoesdr
03-23-2007, 02:54 AM
UPDATE `table` SET `passwrd` = MD5(`passwrd`)

Nightfire
03-23-2007, 03:26 AM
just dont use a where statement, it will then apply to all rows.

huh lol

iLLin
03-23-2007, 03:45 AM
huh lol

UPDATE my_table SET password = 'skillz'.

That would update ever single row in that table with the password skillz.

Troy297
03-23-2007, 04:24 AM
Thanks for all the replies... although I don't quite get the last one... but anyways.....

So all I have to do is the UPDATE query above and it will automatically apply it to every row within the table?

Thanks again!

Inigoesdr
03-23-2007, 04:26 AM
Yes. ;)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum