WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Webmaster, IT and Security Discussion > Database Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Database Discussion Forum This is the place to find help resolving those nagging questions you have about implementing and using all kinds of databases. Need help writing a query? Need an opinion on Oracle? Post here!

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-28-2004, 05:32 PM
WebProWorld New Member
 

Join Date: Jul 2003
Location: Eastern PA, USA
Posts: 5
scamout RepRank 0
Default MD5 - MySQL

I need to take a single-field table in a MySQL database and MD5 hash it into another single-field table. I don't want to lose the plain text table either.

It would seem to me that there'd be a fairly simple query line to do this in MySQLAdmin but I'll be dipped if I can get it right. I'm fairly inept at this sort of thing, being at the level where I can look at code and get an idea what it does and then maybe modify it for my own use.

I've tried all sorts of variations of

INSERT INTO MD5table (hashed) VALUES md5(PlainTable (nothashed));

but always end up getting a message telling me there's an error near the md5.

This shouldn't be difficult, should it?
__________________
Tom Mahoney, Director
Reply With Quote
  #2 (permalink)  
Old 07-28-2004, 09:42 PM
WebProWorld Veteran
 

Join Date: Apr 2004
Posts: 453
HardCoded RepRank 0
Default

Which version of MySQL do you use?
MD5() was added in MySQL 3.23.2

However, your syntax is wrong.
Try:
Code:
INSERT INTO MD5table SELECT MD5(nothashed) FROM PlainTable;
I'm assuming nothashed is the name of the field in PlainTable. If not, adjust as required.
Reply With Quote
  #3 (permalink)  
Old 07-28-2004, 10:38 PM
WebProWorld New Member
 

Join Date: Jul 2003
Location: Eastern PA, USA
Posts: 5
scamout RepRank 0
Default

Version 4.3.4

Thanks - I'll give that a try!
__________________
Tom Mahoney, Director
Reply With Quote
  #4 (permalink)  
Old 07-28-2004, 10:47 PM
WebProWorld New Member
 

Join Date: Jul 2003
Location: Eastern PA, USA
Posts: 5
scamout RepRank 0
Default

Looks like that did it. THANK YOU!!!
__________________
Tom Mahoney, Director
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Database Discussion Forum
Tags: ,



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Search Engine Optimization by vBSEO 3.2.0