dazz_club Posted April 14, 2008 Share Posted April 14, 2008 Hi guys and girls,I am setting up a database and would like to have my passwords encrpted by using MD5, howver i am having trouble writing the sql syntax for this, here is what i have got so far;CREATE TABLE `SourceUK` ( `ID` INT NOT NULL AUTO_INCREMENT, `password` VARCHAR(50) NULL, <-------- where do i put MD5 in this syntax?? `username` VARCHAR(50) NULL, kind regardsDazzclub Link to comment Share on other sites More sharing options...
Synook Posted April 14, 2008 Share Posted April 14, 2008 You don't specify the encryption when setting up tables, you do that when you INSERT. Just make the field VARCHAR(32) (as MD5 hashes are 32 hexadigits long). Link to comment Share on other sites More sharing options...
dazz_club Posted April 14, 2008 Author Share Posted April 14, 2008 You don't specify the encryption when setting up tables, you do that when you INSERT. Just make the field VARCHAR(32) (as MD5 hashes are 32 hexadigits long).aww man then i am buggered, I have .sql file which contains a ###### of alot of members. originally had at least few members, so i just created a form that encrypted the passwords when i submitted them to the database. I tought there may have been a quicker way using sql syntax.aw man, i feel sad now. Link to comment Share on other sites More sharing options...
Synook Posted April 14, 2008 Share Posted April 14, 2008 You could just do on your members table to hash current member's passwords UPDATE SourceUK SET password = MD5(password) Link to comment Share on other sites More sharing options...
dazz_club Posted April 15, 2008 Author Share Posted April 15, 2008 You could just do on your members table to hash current member's passwordsUPDATE SourceUK SET password = MD5(password) Cheers Synook, that's more like it, thanks dude.! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.